/etc/rc.d/sshd restart 測試。telnet Host_IP 22 有回顯,例如 SSH-2.0-OpenSSH_3.8.1p1 FreeBSD-20040419。unable to authenticate using any of the configured authentication methods
這代表 sshd 沒開放密碼認證。編輯設定檔:
# ee /etc/ssh/sshd_config # Change to yes to enable built-in password authentication. PasswordAuthentication yes PermitRootLogin yes
PermitRootLogin 是為了讓 root 直接登入,但從安全角度不建議這樣用;比較好的做法是建立一個帳號並加入 wheel 組,再用 su 切換。
inetd[387]: ssh/tcp: bind: Address already in use ssh stream tcp nowait root /usr/sbin/sshd sshd -i -4
代表 inetd 也在管 22 埠,與獨立運作的 sshd 衝突。把 inetd.conf 裡那一行註解掉:
#ssh stream tcp nowait root /usr/sbin/sshd sshd -i -4
存檔後重啟服務:/etc/rc.d/inetd restart,再重啟 sshd 即可。