ssh -A 参数使用示例

将公钥拷贝到192.168.90.164

[[email protected] ~]$ ssh-copy-id [email protected]

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.

[email protected]‘s password:

Now try logging into the machine, with "ssh ‘[email protected]‘", and check in:

.ssh/authorized_keys

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

[[email protected] ~]$ ssh [email protected]

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

[[email protected] ~]$ logout

Connection to 192.168.90.164 closed.

[[email protected] ~]$

将公钥拷贝到192.168.90.165

[[email protected] ~]$ ssh-copy-id [email protected]

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.

[email protected]‘s password:

Now try logging into the machine, with "ssh ‘[email protected]‘", and check in:

.ssh/authorized_keys

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

[[email protected] ~]$ ssh [email protected]

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

[[email protected] ~]$ logout

Connection to 192.168.90.165 closed.

[[email protected] ~]$

下来这一步最重要

[[email protected] ~]$ ssh-agent bash

welcome robin from /etc/profile.d

[[email protected] ~]$ ssh-add

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

[[email protected] ~]$ 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)

测试效果:

[[email protected] ~]$ ssh -A [email protected]

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

[[email protected] ~]$ ssh -A 192.168.90.165

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

[[email protected] ~]$ logout

Connection to 192.168.90.165 closed.

[[email protected] ~]$ logout

Connection to 192.168.90.164 closed.

[[email protected] ~]$

时间: 2024-08-01 13:21:44

ssh -A 参数使用示例的相关文章

ssh 的参数 -o + 检查是否是无密码访问

转自:http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=29578485&id=5300984 写脚本想检查服务器之间是否建立了 公钥实现了无密码访问查找过程中找到了ssh 的一些参数,贴出来,怕下次找不到了 这些参数可用在 ssh -o 后面 ,每个参数前面都必须有 -o 脚本如下: ssh -o NumberOfPasswordPrompts=0 -o StrictHostKeyChecking=yes 192.168.61

Python3基础 函数 关键字参数 的示例

镇场诗: 诚听如来语,顿舍世间名与利.愿做地藏徒,广演是经阎浮提. 愿尽吾所学,成就一良心博客.愿诸后来人,重现智慧清净体.------------------------------------------ code: def FunAdd(jiaOne,jiaTwo,jianOne) : '单行函数文档' return (jiaOne+jiaTwo-jianOne) #你看这么多参数,万一顺序弄混了,就尴尬了. #所以关键字参数 res=FunAdd(jiaOne=1,jiaTwo=-3,j

Python3基础 函数 收集参数+普通参数 的示例

镇场诗: 诚听如来语,顿舍世间名与利.愿做地藏徒,广演是经阎浮提. 愿尽吾所学,成就一良心博客.愿诸后来人,重现智慧清净体.------------------------------------------ code: # 收集参数 定制参数 定制参数 def MyFun(* paramters, name, key) : print('收集参数的长度:',len(paramters)) print(paramters[1]) print(name) print(key) #如何调用呢? #定

模板的模板参数使用示例

注意:函数模板不支持模板的模板参数. Stack7.h中定义的Stack: #ifndef STACK7_H #define STACK7_H #include <deque> #include <stdexcept> #include <memory> template <typename T, template <typename ELEM, typename = std::allocator<ELEM> > class CONT =

在ASP.NET MVC中以post方式传递数组参数的示例

最近在工作中用到了在ASP.NET MVC中以post方式传递数组参数的情况,记录下来,以供参考. 一.准备参数对象 在本例中,我会传递两个数组参数:一个字符串数组,一个自定义对象数组.这个自定义对象UserInfo定义如下: public class UserInfo { public int UserId { get; set; } public string UserName { get; set; } } 二.后台代码 后台Action代码如下: [HttpPost] public Ac

(转发)在ASP.NET MVC中以post方式传递数组参数的示例

最近在工作中用到了在ASP.NET MVC中以post方式传递数组参数的情况,记录下来,以供参考. 一.准备参数对象 在本例中,我会传递两个数组参数:一个字符串数组,一个自定义对象数组.这个自定义对象UserInfo定义如下: public class UserInfo { public int UserId { get; set; } public string UserName { get; set; } } 二.后台代码 后台Action代码如下: [HttpPost] public Ac

datagrid,treegrid携带参数刷新示例

datagrid携带参数刷新: var queryParams = $("#datagridId").datagrid("options").queryParams; $("#datagridId").datagrid("options").queryParams=queryParams; $("#datagridId").datagrid("reload"); treegrid携带参数

Dubbo -- 系统学习 笔记 -- 示例 -- 参数验证

Dubbo -- 系统学习 笔记 -- 目录 示例 想完整的运行起来,请参见:快速启动,这里只列出各种场景的配置方式 参数验证 参数验证功能是基于JSR303实现的,用户只需标识JSR303标准的验证Annotation,并通过声明filter来实现验证. 2.1.0以上版本支持 验证方式可扩展,参见:Validation扩展点 参数标注示例: import java.io.Serializable; import java.util.Date;   import javax.validatio

ssh 命令

ssh命令是 SSH(全称 Secure Shell)是一种加密的网络协议.使用该协议的数据将被加密,如果在传输中间数据泄漏,也可以确保没有人能读取出有用信息.要使用 SSH,目标机器应该安装 SSH 服务端应用程序,因为 SSH 是基于客户-服务模式的. 当你想安全的远程连接到主机,可中间的网络(比如因特网)并不安全,通常这种情况下就会使用 SSH. 安装 SSH 如果碰巧你的机器没装,我们可以手工来安装一下.最简单的方式就是使用 Linux 包管理器. 基于 Debian / Ubuntu