Re: Possible to setup a SSH port forwarding only (!) in background without showing a Terminal window?
- From: Steve Hayes <steve@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Jan 2010 13:44:28 +0000
Peter Insold wrote:
Whenever I start a SSH port forwarding session with either Windows based
Putty or linux based OpenSSH an additional SSH terminal window is created
Is there a way to created just a background port forwarding session
WITHOUT such a ssh terminal window in foreground?
With linux, you can put the command in a script file and have that run on
system startup, network startup or user login, whichever is most
E.g. I have something similar to the following in ~/.network-autostart and
have that set to run as part of the network startup sequence on my laptop:
/usr/bin/ssh -L1225:localhost:25 -L1443:localhost:143 -CN mydomain.co.uk &
This connects to my server account via port forwarding on the router and
forwards ports 1225 and 1443 on the laptop to ports 25 and 143 on the
server. It is invisible to me as a user: I just set my e-mail client to use
port 1225 on the laptop to send mail and port 1443 to access the IMAP
~/.network-autostop runs when the network disconnects (not unusual with
wireless) and contains
/usr/bin/pkill -u steve ssh
This kills the ssh session and releases the local ports so that forwarding
can be set up again when the network restarts.
I don't know if anything like this can be done with Putty on Windows. If it
can, I'd be interested to hear how to do it as I'd like set up an XP laptop
the same way.
Hope this helps.
Steve Hayes, South Wales, UK
----Remove colours from reply address----
- Prev by Date: case sensitivity, "match user" and "allowusers"
- Next by Date: Re: Which SSH key types (RSA,DSA,1024,2048,...) recommended/most widely used?
- Previous by thread: Re: Possible to setup a SSH port forwarding only (!) in background without showing a Terminal window?
- Next by thread: 665953 Up to date Net and Tech news, knowledge, empowerment 52