可以重启啊 你在检查一下你的sshd_config文件 修改之前备份了吗 对比一下修改前和修改后的区别 [其他解释] 重启sshd时, /var/log/secure 中总出现: Jun 29 15:09:54 localhost sshd[27932]: Server listening on :: port 22. Jun 29 15:09:54 localhost sshd[27932]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
我将端口改为 39 则出现: Jun 29 15:09:54 localhost sshd[27932]: Server listening on :: port 39. Jun 29 15:09:54 localhost sshd[27932]: error: Bind to port 39 on 0.0.0.0 failed: Address already in use. [其他解释] 重启sshd时, /var/log/secure 中总出现: Jun 29 15:09:54 localhost sshd[27932]: Server listening on :: port 22. Jun 29 15:09:54 localhost sshd[27932]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use. ----------------------------- 别随便修改端口 你是如何重启的 用root执行如下命令 看看是哪个程序在使用22号端口 /usr/sbin/lsof -i tcp:22
如果本来就是sshd的话 就说明你的重启方法是错误的 [其他解释]
[root@mail ~]# lsof -i tcp:22 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME sshd 28216 root 3u IPv6 371977901 TCP *:ssh (LISTEN)
# HostKey for protocol version 1 #HostKey /etc/ssh/ssh_host_key # HostKeys for protocol version 2 #HostKey /etc/ssh/ssh_host_rsa_key #HostKey /etc/ssh/ssh_host_dsa_key
# Lifetime and size of ephemeral version 1 server key #KeyRegenerationInterval 1h #ServerKeyBits 768
# Logging # obsoletes QuietMode and FascistLogging #SyslogFacility AUTH SyslogFacility AUTHPRIV #LogLevel INFO
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts #RhostsRSAAuthentication no # similar for protocol version 2 #HostbasedAuthentication no # Change to yes if you don't trust ~/.ssh/known_hosts for # RhostsRSAAuthentication and HostbasedAuthentication #IgnoreUserKnownHosts no
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here! #PasswordAuthentication yes #PermitEmptyPasswords no PasswordAuthentication yes
# Change to no to disable s/key passwords #ChallengeResponseAuthentication yes ChallengeResponseAuthentication no
# Kerberos options #KerberosAuthentication no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes #KerberosGetAFSToken no
# Set this to 'yes' to enable PAM authentication, account processing, # and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication mechanism. # Depending on your PAM configuration, this may bypass the setting of # PasswordAuthentication, PermitEmptyPasswords, and # "PermitRootLogin without-password". If you just want the PAM account and
# session checks to run without PAM authentication, then enable this but set # ChallengeResponseAuthentication=no #UsePAM no UsePAM yes