wangyanlb

ssh相关选项:

  • -V 
    显示版本: 
$ssh -V
OpenSSH_6.6.1p1 Ubuntu-2ubuntu2, OpenSSL 1.0.1f 6 Jan 2014
  • 1
  • 2
  • -f 
    输入密码后进入后台模式 
    (Requests ssh to go to background just before command execution.)

  • -N 
    不执行远程命令,用于端口转发 
    ( Do not execute a remote command. This is useful for just for warding ports (protocol version 2 only).)

  • -D 
    socket5代理 
    (Specifies a local “dynamic” application-level port forwarding.Currently the SOCKS4 and SOCKS5 protocols are supported, and ssh will act as a SOCKS server.)

  • -L 
    tcp转发 
    (Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side.)

  • -C 
    使用数据压缩,网速快时会影响速度 
    (Compression is desirable on modem lines and other slow connections, but will only slow down things on fast networks.The compression algorithm is the same used by gzip)

建立SOCKS5代理:

ssh -f -N -D bindaddress:port name@server
  • 1

bindaddress :指定绑定ip地址 
port : 指定侦听端口 
name: ssh服务器登录名 
server: ssh服务器地址

例如,假设把一个树莓派作为SOCKS5代理服务器,该树莓派的IP地址是192.168.4.160,SOCKS5的端口7070,在树莓派中输入如下命令:

ssh -f -N -D 192.168.4.160:7070 pi@127.0.0.1
  • 1

这样就建立了SOCKS5代理。

分类:

技术点:

相关文章:

  • 2021-11-19
  • 2021-12-20
  • 2021-08-30
  • 2021-11-09
  • 2021-12-04
  • 2021-12-20
  • 2021-12-14
猜你喜欢
  • 2021-11-15
  • 2021-11-09
  • 2021-12-14
  • 2021-12-20
相关资源
相似解决方案