Efficient and more logical port forwarding

Sometimes we need enable port forwarding. But we need to keep that window of the terminal open. If we close that session port forwarding wont work. The following command will minimize this drawback.

ssh -Nf -L <from IP add>:port:<to IP add>:port <localhost/the host on where you want to do this forwarding >

Where,

N = means do not execute a remote cmd. that is don run the shell.

f = Requests ssh to go to background just before command execution.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: