ssh ProxyCommand
来源:互联网 发布:如何起诉装修公司 知乎 编辑:程序博客网 时间:2024/06/13 01:05
The ssh ProxyCommand option is just really insanely useful.The reason I want to use it is that it makes it easy to tunnel ssh through a firewall. So for example you have a machineon your corporate network that is is sitting behind a firewall,but you have a login to the firewall. Now of course you could justdo:
laptop$ ssh gatewaygateway$ ssh internalinternal$
or something like:
laptop$ ssh -t gateway ssh internalinternal$
But that really doesn't work very well if you use scp or sftpor some other service like revision control that runs on top of it.This is where you can use ProxyCommand option to make your life easier.Basically you want to put something like this into you .ssh/config:
Host internal ProxyCommand ssh gw nc -w 1 internal 22
For this to work you will need netcat (nc) installed on thegw, but that generally isn't too much of a problem. Now you can transparently ssh, scp or whatever to internal, and ssh deals with it.
Now of course if you can't get into the network full stop, you need some reverse tunneling tricks and some other host on the interwebwhich you can use to tunnel through. So something like:
ssh -f -nNT -R 1100:localhost:22 somehost
Will setup a remote tunnel, which basically means if you connect toport 1100, it will be forwarded to port 22 on the machine on which youranssh -R
. Unfortunately unless you have full controlover the host you are creating the reverse tunnel too, you will findthat port 1100, will only be bound to localhost, which means you will probably still need to use the trick mentioned above to get seemlessaccess to it.
- ssh ProxyCommand
- ssh ProxyCommand
- SSH ProxyCommand及其思想
- ProxyCommand
- SSH proxycommand:利用跳板机让不在同一局域网的机器ssh直连
- 2段階SSH接続を,ProxyCommandを使って一度のsshコマンドで接続する
- SSH...
- ssh
- ssh
- ssh
- SSH
- ssh
- SSH
- ssh
- SSH
- SSH
- SSH
- ssh
- 那些人,那些话
- 数据结构二叉树的先序中序后序遍历(递归方式)
- 在指定路径创建文件夹, 获取EXE文件的当前目录
- NSDate时间操作
- 设备坐标和逻辑坐标
- ssh ProxyCommand
- 使用 XStream 把 Java 对象序列化为 XML
- include与jsp:include与s:action与s:include与iframe用法汇总(转)
- 生成一个swf文件,Display list (下)
- 使用ASP.NET AJAX的注意事项
- Symbian编程与开发环境设置
- Silverlight.XNA(C#)跨平台3D游戏研发手记:(四)SLG无限自由之过场动画
- ASP.NET控件命名规则
- 生成一个swf文件,Display list(上)