想把某台远程服务器从ssh1升级到ssh2

1. 升级zlib版本到1.2.3

2. 安装openssh

3.在服务器上把ssh2启动到另外一个端口

/usr/sbin/sshd -p 8081

如果启动出如下错误:

 

 

Could not load host key: /etc/ssh/ssh_host_key

Could not load host key: /etc/ssh/ssh_host_rsa_key

Could not load host key: /etc/ssh/ssh_host_dsa_key

Disabling protocol version 1. Could not load host key

Disabling protocol version 2. Could not load host key

sshd: no hostkeys available -- exiting.

则执行:

ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key

 

4.使用ssh xxxx -p 8081连接到远程服务器,杀掉22端口,并启动新的22端口

/usr/sbin/sshd

5.然后使用ssh的22端口连接到远程服务器上,杀掉8081端口即可