ssh 登錄出現(xiàn)的幾種錯(cuò)誤以及解決辦法
2016-01-21 17:24:05
16874
1. 提示錯(cuò)誤如下:
# ssh root@192.168.1.113
ssh: connect to host 192.168.1.113 port
22: No route to host
原因:server端沒(méi)有開(kāi)機(jī)或是網(wǎng)絡(luò)不通,或者就是IP輸錯(cuò)了;
2. 提示錯(cuò)誤如下:
# ssh root@192.168.1.113
ssh: connect to host 192.168.1.113 port 22:
Connection refuse
原因:對(duì)方server的ssh服務(wù)沒(méi)有啟動(dòng);
解決方法:
1) 確定登錄的主機(jī)安裝了openssh-client(如果要使本機(jī)開(kāi)放SSH服務(wù)就需要安裝 openssh-server,鍵入 yum install openssh-server安裝 ;
2) 鍵入ps -e | grep ssh確認(rèn)sshserver是否啟動(dòng)了(看到ssh說(shuō)明啟動(dòng)了,沒(méi)看到則鍵入 /etc/init.d/sshd
start啟動(dòng));
3) ssh-server配置文件位于/ etc/ssh/sshd_config,在這里可以定義SSH的服務(wù)端口,默認(rèn)端口是22,你可以自己定義成其他端口號(hào),如222;
4) 重啟SSH服務(wù): 鍵入 /etc/init.d/ssh stop
鍵入 /etc/init.d/ssh start
5) 登陸SSH:
鍵入:ssh root@192.168.1.113(root為192.168.1.113機(jī)器上的管理員賬號(hào)),然后輸入密碼;
3. 提示錯(cuò)誤如下:
# ssh 192.168.1.113
root@192.168.1.113s password:
Permission denied, please try again.
解決方法:修改 /etc/ssh/sshd_config文件中,將PermitRootLogin no 改為 PermitRootLogin yes,并將前面的注釋#去掉;
會(huì)員登錄
賬號(hào)登錄還沒(méi)有賬號(hào)?立即注冊(cè)