Digital Ocean: ssh_exchange_identification: leia: Conexão redefinida por peer

Digital Ocean: ssh_exchange_identification: leia: Conexão redefinida por peer

Eu tenho uma gota no Digital Ocean. Suas credenciais são compartilhadas com um amigo meu. Costumávamos nos conectar a ele via ssh como: ssh root@IP_Address
Agora por falta de concentração cometemos um erro ao executar o seguinte comando enquanto estávamos no servidor:
sudo chmod -R 777 /
devido a qual servidor não está mais se conectando via nada (SSH/FTP/...) e está dando o seguinte erro:
ssh_exchange_identification: read: Connection reset by peer

Esta é a saída dessh root@IP_Address -vv

OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g 1 Mar 2016 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug2: resolving "IP_Address" port 22 debug2: ssh_connect_direct: needpriv 0 debug1: Connecting to IP_Address [IP_Address] port 22. debug1: Connection established. debug1: key_load_public: No such file or directory debug1: identity file /home/talha/.ssh/id_rsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/talha/.ssh/id_rsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/talha/.ssh/id_dsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/talha/.ssh/id_dsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/talha/.ssh/id_ecdsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/talha/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/talha/.ssh/id_ed25519 type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/talha/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2 ssh_exchange_identification: read: Connection reset by peer

Por favor, ajude-me o mais rápido possível, pois não tenho o backup mais recente de projetos e bancos de dados hospedados.

Agradeço antecipadamente!

Responder1

No mínimo, faça login como root através do console DO (vejaaquipara obter instruções) e faça

chmod 700 /root/.ssh
chmod 600 /root/.ssh/authorized_keys

(em outras palavras, defina os direitos de acesso de /root/.sshto rwx------e de /root/.ssh/authorized_keysto rw-------. O SSH não confiará no arquivo se ele puder ser acessado por outros usuários.

Você também pode ter que definir os direitos de acesso corretos aos arquivos em /etc/ssh:

-rw-r--r--   1 root root 300261 Aug 11  2016 moduli
-rw-r--r--   1 root root   1830 Sep 19  2016 ssh_config
-rw-------   1 root root    672 Oct  2  2016 ssh_host_dsa_key
-rw-r--r--   1 root root    605 Oct  2  2016 ssh_host_dsa_key.pub
-rw-------   1 root root    227 Oct  2  2016 ssh_host_ecdsa_key
-rw-r--r--   1 root root    177 Oct  2  2016 ssh_host_ecdsa_key.pub
-rw-------   1 root root    411 Oct  2  2016 ssh_host_ed25519_key
-rw-r--r--   1 root root     97 Oct  2  2016 ssh_host_ed25519_key.pub
-rw-------   1 root root   1675 Oct  2  2016 ssh_host_rsa_key
-rw-r--r--   1 root root    397 Oct  2  2016 ssh_host_rsa_key.pub
-rw-r--r--   1 root root    338 Sep 19  2016 ssh_import_id
-rw-r--r--   1 root root   2598 Sep 19  2016 sshd_config

informação relacionada