首页 > 其他 > 详细

ssh -A 参数使用示例

时间:2015-05-20 18:39:46      阅读:202      评论:0      收藏:0      [点我收藏+]

将公钥拷贝到192.168.90.164

[robin@90-96 ~]$ ssh-copy-id robin@192.168.90.164

The authenticity of host ‘192.168.90.164 (192.168.90.164)‘ can‘t be established.

RSA key fingerprint is 89:3c:a6:5c:a3:ee:e4:39:89:23:12:87:66:63:13:21.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added ‘192.168.90.164‘ (RSA) to the list of known hosts.

robin@192.168.90.164‘s password: 

Now try logging into the machine, with "ssh ‘robin@192.168.90.164‘", and check in:


  .ssh/authorized_keys


to make sure we haven‘t added extra keys that you weren‘t expecting.


[robin@90-96 ~]$ ssh robin@192.168.90.164

Last login: Wed May 20 17:24:23 2015 from 192.168.90.163

[robin@90-164 ~]$ logout

Connection to 192.168.90.164 closed.

[robin@90-96 ~]$

将公钥拷贝到192.168.90.165

[robin@90-96 ~]$ ssh-copy-id robin@192.168.90.165

The authenticity of host ‘192.168.90.165 (192.168.90.165)‘ can‘t be established.

RSA key fingerprint is 89:3c:a6:5c:a3:ee:e4:39:89:23:12:87:66:63:13:21.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added ‘192.168.90.165‘ (RSA) to the list of known hosts.

robin@192.168.90.165‘s password: 

Now try logging into the machine, with "ssh ‘robin@192.168.90.165‘", and check in:


  .ssh/authorized_keys


to make sure we haven‘t added extra keys that you weren‘t expecting.


[robin@90-96 ~]$ ssh robin@192.168.90.165

Last login: Wed May 20 17:24:19 2015 from 192.168.90.163

[robin@web90-dujia165 ~]$ logout

Connection to 192.168.90.165 closed.

[robin@90-96 ~]$

下来这一步最重要

[robin@90-96 ~]$ ssh-agent bash

welcome robin from /etc/profile.d

[robin@90-96 ~]$ ssh-add

Identity added: /home/robin/.ssh/id_rsa (/home/robin/.ssh/id_rsa)

[robin@90-96 ~]$ ssh-add -l

2048 ec:d6:ac:e0:57:e5:8a:fb:0e:cf:fc:12:4e:3b:2e:93 /home/robin/.ssh/id_rsa (RSA)

测试效果:

[robin@90-96 ~]$ ssh -A robin@192.168.90.164

Last login: Wed May 20 17:27:07 2015 from 192.168.90.96

[robin@90-164 ~]$ ssh -A 192.168.90.165

Last login: Wed May 20 17:26:49 2015 from 192.168.90.96

[robin@web90-dujia165 ~]$ logout

Connection to 192.168.90.165 closed.

[robin@90-164 ~]$ logout

Connection to 192.168.90.164 closed.

[robin@90-96 ~]$ 


ssh -A 参数使用示例

原文:http://tenderrain.blog.51cto.com/9202912/1653273

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!