ssh 登陆 端口转发

man ssh

ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]

  [-D [bind_address:]port] [-e escape_char] [-F configfile] [-I pkcs11]

  [-i identity_file] [-L [bind_address:]port:host:hostport] [-l login_name]

  [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]

  [-R [bind_address:]port:host:hostport] [-S ctl_path] [-W host:port]

  [-w local_tun[:remote_tun]] [user@]hostname [command]

 

-1 Forces ssh to try protocol version 1 only.
-2 Forces ssh to try protocol version 2 only.
-4 Forces ssh to use IPv4 addresses only.
-6 Forces ssh to use IPv6 addresses only.

-b bind_address

  当系统中有多个ip时,可以用这个参数来指定一个ip,来跟远程主机连接。只有1个ip时无效。

-D [bind_address:]port

  本地创建一个socks代理服务,绑定bind_address,监听port端口。在本机网络配置里修改 socks 代理服务器为 bind_address:port,就可以以远程主机的身份访玩耍啦。

-i identity_file

  指定你的私钥文件。

  ssh-add identity_file 之后,可以不用再指定私钥文件就能登陆。

  密钥文件生成命令 ssh-keygen

-L [bind_address:]port:host:hostport

  本地有个 socket 绑定 bind_address,监听 port 端口,所有发到本地主机 port 端口的数据,都被通过远程主机发到 host 的 hostport 端口。

-R [bind_address:]port:host:hostport

  远程主机有个 socket 绑定 bind_address,监听 port 端口,所有发到远程主机 port 端口的数据,都被通过本地主机发到 host 的 hostport 端口。

  -L 和 -R 中的 [bind_addres:]port 总是相对于被转发数据的机器的。也就是会开启一个 socket 的那个机器。host:hostport 相对于另一端。

-p port

  指定要连接的远程端口

 

转载于:https://www.cnblogs.com/hangj/p/4518643.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值