openssh continues to process dash arguements after hostname

Corinna Vinschen vinschen at redhat.com
Thu Apr 29 22:55:49 EST 2004


On Apr 28 06:35, Markus Friedl wrote:
> On Wed, Apr 28, 2004 at 02:02:33PM +1000, Mark Andrews wrote:
> > 	No.  It was claimed  that it was for compatability with
> > 	rsh.  Accepting flags on both side breaks compatibility.
> > 
> > 	"rsh -l user hostname -foo" will attempt to execute "-foo"
> > 	"ssh -l user hostname -foo" will attempt to process "-foo" as
> > 	flags.
> 
> ssh does this for almost 10 years and will continue to do so.
> 
> 	ssh -v host -p 1234
> 
> is very common.

It's called "argument permutation" and it's a well-known and documented
behaviour in the getopt and (FWIW here) the getopt_long man pages on many
systems.  Various systems have various defaults, though.  If you don't
like it, you can use the POSIXLY_CORRECT environment variable.


Corinna

-- 
Corinna Vinschen
Cygwin Co-Project Leader
Red Hat, Inc.




More information about the openssh-unix-dev mailing list