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 ~]#