ssh-agent && ssh-agent forward && SSH ProxyCommand

SSH Agent Forwarding原理 http://www.w3hacker.com/?p=156
使用SSH Agent Forwarding http://www.w3hacker.com/?p=158
SSH Agent主要为了缓存公匙中的密码,减少用户输入密码的次数。

SSH ProxyCommand

How it Work?

A connection is established to the bastion host
+-------+            +--------------+
|  you  | ---ssh---> | bastion host |
+-------+            +--------------+
Bastion host runs netcat to establish a connction to the target server
+--------------+                +--------+
| bastion host | ----netcat---> | server |
+--------------+                +--------+
Your client then connects through the netcat tunnel and reaches the target server
+-----+                  +--------------+                +--------+
| you |                  | bastion host |                | server |
|     | ===ssh=over=netcat=tunnel======================> |        |
+-----+                  +--------------+                +--------+

How to use the ssh proxycommand

# clent:
$ vim ~/.ssh/config
... 
Host superchunk.example.org
	ProxyCommand  ssh [email protected] nc %h %p
...

# ssh connection result
$ ssh superchunk.example.org
Password: 
[email protected] password: 
Last login: Wed Jun 25 12:05:47 2008 from 10.0.0.221
[user@superchunk ~]$

你可能感兴趣的:(command)