更改 sshd_config 檔案後啟動 ssh 伺服器

更改 sshd_config 檔案後啟動 ssh 伺服器

我的伺服器只允許透過 ssh 無密碼 root 登入。例如,ssh[電子郵件受保護]我想啟用用戶登錄,例如 ssh[電子郵件受保護]會要求輸入密碼。

我透過註解掉以下行來編輯 sshd_config 檔案:

AuthorizedKeysFile %h/.ssh/authorized_keys

閱讀:

#AuthorizedKeysFile .ssh/authorized_keys

並重新啟動 ssh 伺服器

/etc/init.d/ssh restart

我立即被踢出伺服器,現在當我輸入[電子郵件受保護]或者[電子郵件受保護],我收到此錯誤:

ssh: connect to host myserver.com port 22: Connection refused

有什麼方法可以讓 ssh 存取回我的伺服器,並可能啟用使用者登入?

答案1

Connection Refused是 TCP 等級錯誤,意味著沒有服務綁定到連接埠 22 the ssh server is no longer running

在這裡恢復的最佳選擇將是實體終端,看起來好像您的系統可能已損壞sshd_配置文件,且伺服器無法重新啟動。

相關內容