私は Digital Ocean にドロップレットを持っています。その認証情報は友人の 1 人と共有しています。
ssh root@IP_Address
以前は次のように ssh 経由で接続していました。集中力が欠けていたため、サーバー上で次のコマンドを実行するというミスを犯しました。
sudo chmod -R 777 /
その結果、サーバーは (SSH/FTP/...) 経由では接続できなくなり、次のエラーが発生します。
ssh_exchange_identification: read: Connection reset by peer
これは、ssh 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
ホストされているプロジェクトとデータベースの最新のバックアップがないので、できるだけ早く助けてください。
よろしくお願いします!
答え1
最低限、DOコンソール経由でルートにログインします(ここ手順については、
chmod 700 /root/.ssh
chmod 600 /root/.ssh/authorized_keys
(言い換えると、 のアクセス権を/root/.ssh
に設定し、のアクセス権を にrwx------
設定します。他のユーザーがアクセスできる場合、SSH はファイルを信頼しません。/root/.ssh/authorized_keys
rw-------
/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