Open annidy opened 11 months ago
使用跳板机
# 下面两种都可以 ssh -J <jump server> <remote server> ssh -o ProxyCommand="ssh -W %h:%p <jump server>" <remote server>
How To Use SSH ProxyJump and SSH ProxyCommand 如何通过命令/配置config file跳转
ssh常用参数
-W
-W %h:%p
-t
-T
-i
部分跳板机不支持端口转发,只能用伪终端登录
迂回方法 ssh -t <jump server> ssh <remote server>
ssh -t <jump server> ssh <remote server>
文件传输用rsync
rsync -P -avz -e '/usr/bin/ssh <jump server> ssh' local_file <remote server>:remote_file
使用跳板机
How To Use SSH ProxyJump and SSH ProxyCommand 如何通过命令/配置config file跳转
ssh常用参数
-W
: 端口转发。-W %h:%p
表示将本地标准输出重定向到远程主机的标准输入-t
: 登录后强制分配一个伪终端用于交互-T
: 测试登录。成功后退出-i
: 指定私钥文件