sshtunnel

 

介紹:

sshtunnel 是一個令透過 uci 指令可以設定 ssh tunnel 的包來

 

安裝:

opkg install --nodeps sshtunnel

 

設定檔:

/etc/config/sshtunnel

# 第一部份內容

config 'server'                      'vps'
option 'user'                       'sshtunnel'
option 'hostname'                   'vps.datahunter.org'
option retrydelay                    5
option ServerAliveInterval           3
option ServerAliveCountMax           4
option IdentityFile                   /root/sshtunnel.key

 

UCI:

sshtunnel.vps=server
sshtunnel.vps.user=sshtunnel
sshtunnel.vps.hostname=vps.datahunter.org
sshtunnel.vps.retrydelay=5
sshtunnel.vps.ServerAliveInterval=3
sshtunnel.vps.ServerAliveCountMax=4
sshtunnel.vps.IdentityFile=/root/sshtunnel.key

 

# 第二部份

 

tunnel 一共分 3 種形式 tunnelR, tunnelL, tunnelD

tunnelR  <--- ssh -R .......
tunnelL  <---  ssh -L .......
tunnelD

 

# tunnelR(emote)

config tunnelR http
       option server           home
       option remoteaddress    *
       option remoteport       9009
       option localaddress     192.168.1.13
       option localport        80

# tunnelL(ocal)

config tunnelL myforward
       option server           disney
       option localaddress     *
       option localport        1022
       option remoteaddress    secretserver.disney.com
       option remoteport       22

 

# tunnelD(ynamic)

config tunnelD myproxy
       option server           home
       option localaddress     *
       option localport        4055

UCI:

sshtunnel.myproxy=tunnelD
sshtunnel.myproxy.server=vps
sshtunnel.myproxy.localaddress=*
sshtunnel.myproxy.localport=4055

port ( default 22 )
retrydelay     (default 10s) <-- Delay after a connection failure
Compression  (default no )
CheckHostIP (default no )  check the host in the known_hosts file
IdentityFile (~/.ssh/id_rsa)
ServerAliveCountMax
ServerAliveInterval  <-- Sets a timeout interval in seconds
VerifyHostKeyDNS <-- verify the remote key using DNS and SSHFP resource records.