windows 通过SSH 访问 Ubuntu 16.04
1、首先确保已安装ssh,若未安装通过以下指令进行修改
(在root用户下操作)
apt-get install openssh-server openssh-client
apt-get install ssh
2、启动 ssh服务:/etc/init.d/ssh start
再查看进程 :ps -e | grep ssh,查看sshd(虚拟机作为服务器)这个进程是否运行,ssh-agent(虚拟机作为客户端)
若无这个进程sshd,可能是配置文件出了问题,建议将ssh及其配置文件全部卸载重新安装,若了解配置文件直接修改配置文件也可。
清除式卸载:apt-get purge openssh-server
apt-get purge openssh-client
apt-get purge ssh
(清除配置文件并卸载ssh)
3、使用secure-CRT通过ssh协议远程登陆访问root用户,若输入正确的密码结果显示密码错误无法登陆;
则需修改ssh的配置文件。
(1)
vim /etc/ssh/sshd_config
将PermitRootLogin修改成yes
在文件最后面添加:
Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc
MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha1-96,hmac-md5-96
KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org
- (2)
重启SSH服务:service ssh restart