windows中命令帮助如下
- 直接连接远程端口:
ssh username@remote_host
- 通过密钥连接:
ssh -i path/to/key_file username@remote_host
-指定端口连接:
ssh username@remote_host -p 2222
- 执行一个命令:
ssh remote_host command -with -flags
- ssh隧道:动态端口转发 (SOCKS proxy on localhost:9999):
ssh -D 9999 -C username@remote_host
- 隧道: 指定端口转发 (localhost:9999 to example.org:80) along with disabling pseudo-[t]ty allocation and executio[n] of remote commands:
ssh -L 9999:example.org:80 -N -T username@remote_host
- ssh跳板:通过跳板机器连接远程机器多个跳板使用逗号隔开:
ssh -J username@jump_host username@remote_host
-代理转发: 代理认证信息到远程机器 (see man ssh_config for available options):
ssh -A username@remote_host
ssh连接会经常掉线我们可以使用个另外一个脚本工具进行保持【autossh】
具体可以参考这篇文章
相关命令
autossh -N -M 0 \
Server> -o "ServerAliveInterval 30" \
> -o "ServerAliveCountMax 3" \
> -L 55555:0.0.0.0:10086 \
> root@x.x.x.x -v