[patch] Re: -n vs batch_mode vs batch_flag

Markus Friedl Markus.Friedl at informatik.uni-erlangen.de
Mon Apr 9 17:16:36 EST 2001


On Mon, Apr 09, 2001 at 10:58:59AM +0900, Tom Holroyd wrote:
> On Sun, 8 Apr 2001, Markus Friedl wrote:
> 
> > i did not invent '-n' but the manpage reads:
> >
> >      -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 ma-
> >              chine.  For example, ssh -n shadows.cs.hut.fi emacs & will start
> >              an emacs on shadows.cs.hut.fi, and the X11 connection will be au-
> >              tomatically forwarded over an encrypted channel.  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.)
> > 	     ^^^^^^^^^^^^^^^^^^^^^			   ^^^^^^^^^^^^^
> 
> Yes, I read that.  Notice how ssh doesn't do what that says.
> 
> > > 	% ssh -n localhost &
> > > 	[1] 5220
> > > 	% tomh at localhost's password:
> > > 	[1]  + Suspended (tty input)         ssh -n localhost

this is what the manpages says.

> According to the man page, -n should _prevent_ reading from stdin, but it
> doesn't.

ssh does not read from stdin, but from the tty.

why don't you use -f ?

-m



More information about the openssh-unix-dev mailing list