Is there a way to created just a background port forwarding session WITHOUT such a ssh terminal
window in foreground?
Peter
man ssh, look for -f, -n and -T.
DES
--
Dag-Erling Smørgrav - d...@des.no
Yes but If you only want secure port forwarding then stunnel is a simpler
and maybe better choice.
Regards.
How do you start up the ssh client? I can't imagine why this would
start up a new "SSH terminal window" in Linux (AFAIK there is no such
thing - do you mean in runs in a seperate [x|a|e|k]term?)
If you are manually starting it, then how do you propose shutting it
down if it's not associated with a tty?
C.
In many cases, you don't _want_ it shut down. It can be used to
provide a quiet, VPN-like connection to a remote port, active 24x7. In
fact, for such cases, it's useful to use something like "autossh", at
http://www.harding.motd.ca/autossh/. That doesn't help with Putty, but
it's an example of the kind of use involved.
Mind you, it does create it's own fascinating security issues....
On windows, you may be interested in putty's cousin plink and it's
-batch option
http://the.earth.li/~sgtatham/putty/0.53b/htmldoc/Chapter7.html#7.2.3
Get plink here
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
That's the -N option to ssh. However the use of it is under the ssh
user's control not the ssh server admin's control. To limit what the
user can do at the server end it is necessary to use the sshd config
directives Match and ForceCommand (man sshd_config for details).
Where is the FAQ for this group? This should definitely be in it.
--
James Taylor
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
appropriate.
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:
#!/bin/sh
/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
server.
~/.network-autostop runs when the network disconnects (not unusual with
wireless) and contains
#!/bin/sh
/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----