Permanent SSH / Running SSH in Background
July 6, 2009 Leave a Comment
After searching and searching on google .. i haven’t see something that can fulfil my needs to create persistent SSH.
So .. i try to open ssh man page (ya ya ya .. i know .. I should open it 1st before searching anywhere) and got the option,
so what you need to do only :
- running it in background
- send all the log to /dev/null –> in my case, i never interested to see SSH log hihihihi
- create a tunnel
and from above requirement here it is the command :
ssh -T -f -N -L source_port:target_ip_tunnel:target_port username@host -p ssh_port
Note : (-p ssh_port) is optional if your default ssh port not 22.
That’s all folks !!