Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Unix知識 >> 關於Unix

FreeBSD 5.4 無法用 SecureCRT 連線?檢查 sshd 設定

先確認前提

  1. sshd 已啟動,可用 /etc/rc.d/sshd restart 測試。
  2. 連接埠處於 LISTEN 狀態。
  3. 遠端 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 即可。

Copyright © Linux教程網 All Rights Reserved