jacobsvante / bgtunnel

Initiate SSH tunnels in the background in python
MIT License
48 stars 12 forks source link

Usedefaults #15

Closed jmdcal closed 9 years ago

jmdcal commented 9 years ago

Here is a simple hack to allow ssh to use defaults. We don't need to specify the user and host if not needed.

jacobsvante commented 9 years ago

If a host address is not specified, then SSH will fail with Bad local forwarding specification. This is the case with this perfectly valid bgtunnel command for example:

bgtunnel 10.0.1.2 --host-port 23456

(Generates this SSH command:)

/usr/bin/ssh -o BatchMode=yes -o ConnectionAttempts=1 -o ConnectTimeout=60 -T -L 60727:23456 10.0.1.2

This is because the -L argument requires a host address. If you have a good way around this I can look further into it.