vi /etc/ssh/sshd_config # default value. Port 6232 //之前這個前面是有 # 號的,並且默認是 22 ,修改一下就ok了 #Protocol 2,1 #ListenAddress 0.0.0.0 #ListenAddress :: # 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_keylinux
注意:重啓以前 若是在iptables 配置了22 端口那還的修改一下iptables 不然重啓後就被擋道外面,鏈接不上服務器了服務器
[root@linux ~]# /etc/init.d/sshd restart Stopping sshd: [ OK ] Starting sshd: [ OK ] [root@linux ~]#