How to kill a background ssh process?



I need to have a background ssh tunnel.

It is setup like this:
$ ssh -n -N -C -o "StrictHostKeyChecking no" -L 5433:localhost:5432
1.2.3.4 &

It needs to eventually be killed and restarted with another server IP.
What I'm doing is sending it a SIGTERM and it works but leaves a
defunct process. This is not too big a deal but I want it clean.

I have read from the man that a ~ followed by a . from stdin closes the
connection, but the manual also states that the -n option must be used
when ssh is to run in the background.

What is the best approach?

Regards, Clodoaldo PInto

.



Relevant Pages

  • Re: How to kill a background ssh process?
    ... CP> I need to have a background ssh tunnel. ... It is setup like this: ... from stdin ... CP> closes the connection, but the manual also states that the -n ...
    (comp.security.ssh)
  • Re: Specified network name is no longer available
    ... ISP says nothing wrong with the connection.. ... Also it works just fine if the guys make a dial up VPN connection to ... On it's own the SBS2003 server worked well, ... So Site B was setup. ...
    (microsoft.public.windows.server.sbs)
  • RE: Not connecting to server or desktop throught RWW
    ... Can I conform that you can not setup the second connection to the SBS ... server or desktop through RWW site? ...
    (microsoft.public.windows.server.sbs)
  • Re: NAT on SBS2003 not working
    ... The comunication between NIC and DSL: modem isn't an issue. ... server I can access the internet and newsgroups just fine. ... It's just that the clients aren't seeing the server's connection. ... But the setup Susan provided ...
    (microsoft.public.windows.server.sbs)
  • Re: Need Help with VPN in Workgroup
    ... is setup properly, then try from outside the network. ... Remember XP will only accept one connection at a time. ... Our Windows NT server recently died and was replaced with a Win XP Media ...
    (microsoft.public.windowsxp.work_remotely)

Quantcast