Re: launching background processes using ssh

From: Bill Weiss (
Date: 10/23/03

  • Next message: Darren Tucker: "Re: Forced Password Changes"
    Date: Wed, 22 Oct 2003 19:55:02 -0600

    Pascal J.Bourguignon(, Oct 22, 2003 at 08:56:18PM +0200:
    > Samuel Richard writes:
    > > I want to use ssh to launch programs on several hosts.
    > > The problem is that my programs do not return, and even if I launch them
    > > in background, ssh hangs on.
    > >
    > > Does anybody have any solution?
    > Redirect stdin, stdout and stderr:
    > ssh remote 'xclock -display :0.0 </dev/null >/dev/null 2>&1 &'

    This is ridiculous.

    man ssh:
    Redirects stdin from /dev/null (actually, prevents reading from stdin).
    This must be used when ssh is run in the background. A common trick is to
    use this to run X11 programs on a remote machine. For example, ssh -n emacs & will start an emacs on, and
    the X11 connection will be automatically forwarded over an encrypted chan-
    nel. The ssh program will be put in the background. (This does not work
    if ssh needs to ask for a password or passphrase; see also the -f option.)

    Requests ssh to go to background just before command execution. This is
    useful if ssh is going to ask for passwords or passphrases, but the user
    wants it in the background. This implies -n. The recommended way to
    start X11 programs at a remote site is with something like ssh -f host

    What would be the problem with using the built in solutions?

    Bill Weiss
    There are no problems that cannot be solved by the judicious use
    of high explosives.
            -- Unknown

  • Next message: Darren Tucker: "Re: Forced Password Changes"

    Relevant Pages

    • Re: SSH: remote login returns "invalid user"
      ... do you differentiate between client hosts and server hosts and most ... with your current account being "brownh" and you ... At present, I have three or four hosts on a LAN, and I can ssh from ...
    • Re: openssh concerns
      ... in to ssh. ... No protection is afforded against DNS poisoning, ... Hosts with no reverse DNS ... big service providers like google and hotmail. ...
    • Re: IPV6 & pf
      ... das einzige was mir auffällt sind icmpv6 Fehler. ... Oben sieht man die funktionierende Verbindung, ... Wenn Du auf beiden Hosts tcpdump vergleichst, ... ssh auch direkt pingen. ...
    • Re: Whats the deal on the -X vs -Y thing?
      ... As a quick fix you could use something like this as your remote ssh ... chain is compromised (eg at either the tty layer, X11 forwarding port ... forwarding would not be needed on the intermediate hosts. ...
    • Re: what checking should FW-1 perform?
      ... >> some selected hosts on the other side. ... >> So I am going to supply the source IP, username and SSH public dsa key ... >> for each client with a list of IPs want to connect to. ...