天天看點

Junipor交換機 ssh_exchange_identification: Connection closed by remote host

可根據以下步驟使其ssh服務恢複正常:

Step1 check the files are present in the directory by login in to the switch and you should be in the shell

[email protected]:RE:0% ls /etc/ssh/ssh*

/etc/ssh/ssh_host_dsa_key       /etc/ssh/ssh_host_rsa_key

/etc/ssh/ssh_host_dsa_key.pub   /etc/ssh/ssh_host_rsa_key.pub

/etc/ssh/ssh_host_key           /etc/ssh/ssh_known_hosts

/etc/ssh/ssh_host_key.pub

[email protected]:RE:0% ls /config/ssh*

/config/ssh_host_dsa_key        /config/ssh_host_key

/config/ssh_host_dsa_key.pub    /config/ssh_host_key.pub

/config/ssh_host_ecdsa_key      /config/ssh_host_rsa_key

/config/ssh_host_ecdsa_key.pub  /config/ssh_host_rsa_key.pub

Step 2 Make two directory under the /etc/ by following  command

[email protected]:RE:0% cd /etc

[email protected]:RE:0% mkdir test1

[email protected]:RE:0% mkdir test2

[email protected]:RE:0% ls ----- by issuing this command you will be able to see the directory test under /etc

fbtab                   newsyslog.conf.sys      sshd_netconf

fstab                   notices                 stunnel.conf

ftpusers                pam.conf                syslog.conf

gettytab                pam.conf.sys            termcap

group                   passwd                  termcap.small

group.sys               profile                test1

test2

step3 copy the files under /etc/ssh/ssh* to the directory test1 and also copy /config/ssh* to directory test2

[email protected]:RE:0% cp /etc/ssh/ssh* /etc/test1

[email protected]:RE:0% cp /config/ssh* /etc/test2

[email protected]:RE:0% ls /etc/test1

[email protected]:RE:0% ls /etc/test2

Step4 then you have to create a directory under the /var/

[email protected]:RE:0% cd /var/

[email protected]:RE:0% mkdir empty

重新開機交換機:

request system reboot

後可正常登陸

繼續閱讀