xiaoxiao 发表于 2015-2-21 20:40:04

使用自带的终端进行SSH,并解决输入密码不能正常登录问题

本帖最后由 xiaoxiao 于 2015-2-21 22:26 编辑

Windows下我习惯用PUTTY来ssh登录,Mac直接使用Terminal即可。


ssh的一些常用命令:
使用root账号登录指定ip的服务器。下面需要把ip换成你自己服务器的ip。
ssh root@ip

如果服务器使用的不是标准端口,比如是4567端口,则是:
ssh root@ip -p 4567

MAC下还有窗口方式:
先打开一个终端,在菜单栏点选 Shell– 新建远程连接,如下


这时候会出新一个窗口,如下:


选择安全Shell(ssh),输入服务器ip地址和用户名




如果服务器使用的不是标准端口,则可以在后面添加 -p 端口号


例如:连接到IP地址192.168.1.1,端口号为1234。则再最后添加 -p 1234
ssh root@192.168.1.1 -p 1234

完成后在SSH菜单上点选 导出设置,在你的桌面就会看到一个你刚刚命名的 test.terminal。


或者也可以使用SecureCRT工具
Windows:
http://www.aixiaoxiao.cn/thread-137-1-1.html
Mac:
http://www.aixiaoxiao.cn/thread-177-1-1.html




有时候重装服务器再次连接,输入密码不能正常登录。提示:
Password:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!   @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
ea:24:31:8d:03:07:36:db:2f:74:15:5d:58:67:a3:5b.
Please contact your system administrator.
Add correct host key in /var/root/.ssh/known_hosts to get rid of this message.
Offending key in /var/root/.ssh/known_hosts:1
RSA host key for 192.168.1.1 has changed and you have requested strict checking.
Host key verification failed.


解决方法:
只要清除老的公钥信息就可以了。
ssh-keygen -R 192.168.1.1(你远程服务器的IP)



页: [1]
查看完整版本: 使用自带的终端进行SSH,并解决输入密码不能正常登录问题