Mailing List Archive

[Bug 1473] Add option to save PID of a backgrounded ssh process
https://bugzilla.mindrot.org/show_bug.cgi?id=1473


Damien Miller <djm@mindrot.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |djm@mindrot.org




--- Comment #1 from Damien Miller <djm@mindrot.org> 2008-05-29 05:12:16 ---
You can control a running SSH process using the control socket

ssh -nNfL 123:remote_host:456 -MS ~/.ssh/ctl-%r-%h-%p__%l user@host

You can ask the master process to exit gracefully using:

ssh -S ~/.ssh/ctl-%r-%h-%p__%l -O exit user@host

See the ControlPath and ControlMaster documentation in ssh_config(5)
for more information.

--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
_______________________________________________
openssh-bugs mailing list
openssh-bugs@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-bugs
[Bug 1473] Add option to save PID of a backgrounded ssh process [ In reply to ]
https://bugzilla.mindrot.org/show_bug.cgi?id=1473


Darren Tucker <dtucker@zip.com.au> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |dtucker@zip.com.au




--- Comment #2 from Darren Tucker <dtucker@zip.com.au> 2008-05-29 10:10:58 ---
You can also do it with some trivial shell scripting:

#!/bin/sh
echo $$ >ssh.pid
exec ssh user@host -L 123:remote.host:456 -f -N

--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
_______________________________________________
openssh-bugs mailing list
openssh-bugs@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-bugs
[Bug 1473] Add option to save PID of a backgrounded ssh process [ In reply to ]
https://bugzilla.mindrot.org/show_bug.cgi?id=1473





--- Comment #3 from Tim Steiner <tsteiner@nerdclub.net> 2008-05-30 01:09:20 ---
Damien: Thanks for the tip. I was unaware of ControlMasters.

Darren: Actually, since the ssh process is forking, the pid your script
saves is that of the parent process, and not the new child process.

I suppose something like this would work:

#!/bin/sh
echo $$ >pid.sh
exec ssh user@host -L 123:remote.host:456 -N

The downside is that you have to run it in the background, and ssh
won't be able to prompt for a password (if needed).

--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
_______________________________________________
openssh-bugs mailing list
openssh-bugs@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-bugs
[Bug 1473] Add option to save PID of a backgrounded ssh process [ In reply to ]
https://bugzilla.mindrot.org/show_bug.cgi?id=1473





--- Comment #4 from Tim Steiner <tsteiner@nerdclub.net> 2008-05-30 01:10:49 ---
Oops, that should have been ssh.pid above, not pid.sh!

--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
_______________________________________________
openssh-bugs mailing list
openssh-bugs@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-bugs