Why have you wrote about a tunnel in background? This command don't put ssh tunnel in background. It makes a tunnel in verbose mode.
To create a tunnel in background give: ssh -f -N -L localport:destination.ip:destination.port username@ssh_server.ip
where -f forces ssh to run in background but in this case it wants a command to execute, if you only want to create a tunnel, give the -N that indicates that's no command to be execute or only the tunnel
Anonymous: To keep it "on cycle" look into autossh. Params are similar to ssh (in fact they're just passed in), but has additional params like ssh monitoring port and number of seconds for timeout or retry. I use autossh for persistent ssh tunnel.
3 comments:
Why have you wrote about a tunnel in background? This command don't put ssh tunnel in background. It makes a tunnel in verbose mode.
To create a tunnel in background give:
ssh -f -N -L localport:destination.ip:destination.port username@ssh_server.ip
where -f forces ssh to run in background but in this case it wants a command to execute, if you only want to create a tunnel, give the -N that indicates that's no command to be execute or only the tunnel
Best regards.
Matteo Brutti
Guys, what about leaving that connection on cycle, so that it would reconnect on disconnection?
Anonymous: To keep it "on cycle" look into autossh. Params are similar to ssh (in fact they're just passed in), but has additional params like ssh monitoring port and number of seconds for timeout or retry. I use autossh for persistent ssh tunnel.
Post a Comment