Ubuntu14.04解決ssh登入不上
阿新 • • 發佈:2019-01-10
新裝了一個VMware虛擬機器,Ubuntu14.04LTS版本。
ssh登入,有時候登入不上,有時候能登上。前提:確保網路連通
在windows和ubuntu上相互ping 是否能通
橋接和nat
解決辦法: (1)檢視ip地址是否衝突 我在單位的虛擬機器ip地址是192.168.0.102與其它機器衝突了。改成了192.168.14.83
(2)關閉Ubuntu14.04的防火牆
[email protected]:~# sudo ufw disable
防火牆在系統啟動時自動禁用
(3)Ubuntu系統上安裝、啟動sshd服務
sudo apt-get install openssh-server
sudo /etc/init.d/ssh restart
【對於CentOS系統,啟動sshd服務,請參考】http://blog.csdn.net/fenglailea/article/details/12191607
(4)ssh還不能登入上,就修改sshd的預設配置
ssh出現permission denied(publickey)問題:
修改/etc/ssh/sshd-config檔案.
將其中的PermitRootLogin no修改為yes
PubkeyAuthentication yes修改為no
AuthorizedKeysFile.ssh/authorized_keys前面加上#遮蔽掉,
PasswordAuthenticationno修改為yes就可以了。
/etc/ssh/sshd-config檔案
Subsystem sftp /usr/libexec/openssh/sftp-serverPort 22
Protocol 2
PermitRootLogin no
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
#CACertificateFile /etc/ssh/ca/ca.cert
PasswordAuthentication no
PermitEmptyPasswords no
PrintMotd no
ChallengeResponseAuthentication no
UseDNS no
ClientAliveInterval 60
win7上ssh客戶端,可以使用SSH Secure Shell 或者 SecureCRT檔案