Re: launching background processes using ssh

From: Bill Weiss (houdini_at_nmt.edu)
Date: 10/23/03

  • Next message: Darren Tucker: "Re: Forced Password Changes"
    Date: Wed, 22 Oct 2003 19:55:02 -0600
    To: secureshell@securityfocus.com
    
    

    Pascal J.Bourguignon(pjb@informatimago.com)@Wed, 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:
    -n
    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
    shadows.cs.hut.fi emacs & will start an emacs on shadows.cs.hut.fi, 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.)

    -f
    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
    xterm.

    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 ...
      (Debian-User)
    • 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. ...
      (FreeBSD-Security)
    • 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. ...
      (de.comp.os.unix.bsd)
    • 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. ...
      (comp.security.ssh)
    • Re: Apache Software Foundation Server compromised, resecured. (fwd)
      ... >> to selectively forward keys to hosts, or express policy regarding whether ... >> keys are then forwarded by the host you have connected to. ... My biggest complaint with ssh is the way ...
      (FreeBSD-Security)