win7 ssh client to ssh server:
1.下载ssh server:MobaSSH_Server:http://mobassh.mobatek.net/MobaSSH_Server_Home_1.60.zip
2.下载ssh client: puttyhttp://the.earth.li/~sgtatham/putty/0.67/x86/putty.exe
putty增强版:https://github.com/FauxFaux/PuTTYTray/releases/tag/p0.66-t028
3. 测试本地连接ssh:输入Host Name为127.0.0.1 ==>open
login as:winName
winName@127.0.0.1's password:
VMware Ubuntu server ssh client to Win7 ssh server:
1.ubuntu默认已经安装 ssh client
也可 sudo adp-get install openssh-client
2.登录:
ssh 192.168.19.132 -l winName
winName@192.168.19.132’s password:
Win7 ssh client to VMware Ubuntu server ssh server:
1.sudo apt-get install openssh-server
2.查看运行状态ps -e | grep ssh 或者 ps aux|grep ssh
如果发现sshd表明服务器正常
3.执行./etc/init.d/ssh start
4.本地测试
ssh localhost
一律yes
如错选no可以换ssh 127.0.0.1
如再错选no可以重新生成公钥和私钥
ssh-keygen -t rsa -P ""
回车保存,追加公钥到文件
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
测试ssh localhost
显示:
Welcome to Ubuntu 15.10 (GNU/Linux 4.2.0-16-generic x86_64)
* Documentation: https://help.ubuntu.com/
Last login: xxxxxxx
本地测试成功
5.查看Ubuntu ip
ifconfig -a
6.win7 打开putty
输入Host Name为192.168.19.130(Ubuntu ip) ==>open
一律yes
login as:ubuntuName
ubuntuName@192.168.19.130's password:
注意:ubuntuName不能为root权限
可以在Ubuntu中打开root远程登录权限:
-
输入root账户和密码
-
编辑ssh的配置文件,命令:nano /etc/ssh/sshd_config
-
在Authentication部分,注释掉“PermitRootLogin without-password”
-
在Authentication部分,添加“PermitRootLogin yes”
-
重新启动ssh服务,命令:sudo service ssh restart
-
然后就可以使用root帐号登录ssh
ctrl+d或者 exit 退出远程登录