ssh argv[0] support

Jonathan Amery jdamery at chiark.greenend.org.uk
Sat Sep 15 01:52:19 EST 2001


In article <84vgim2bv6.fsf at rjk.greenend.org.uk> you write:
>Jonathan Amery <jdamery at pick.ucam.org> writes:
>
>> #! /bin/sh -e
>> if [ "${0##*/}" == "ssh-argv0" ]
>> then
>>   echo 'ssh-argv0: This script should not be run like this, see
>> ssh-argv0(1) for details' 1>&2;
>>   exit 1;
>> fi
>> ssh "${0##*/}" "$@"
>What's wrong using with shell aliases to achieve the same effect?

 (a) This replaces a feature that was removed from openssh in
2.3.something (or there abouts).

 (b) The only way I've seen the feature used on a large scale is to
have a symlink farm in /usr/local/<something> which then allows all
users of the machines to use this feature, regardless of which shell
they use (and in local scripts and the like).

>In fact I think shell aliases are actually better.  For example, using
>bash alias syntax:
>
>  alias pick="ssh jdamery at pick.ucam.org"
>
>would work even when ucam.org wasn't in the DNS search list or when
>your local username wasn't jdamery, situations in which just linking
>~/bin/pick to your proposed ssh-argv0 would fail.

 That's what your .ssh/config is for, for example (from my .ssh/config 
at work):

Host chiark
HostName login.chiark.greenend.org.uk
Compression yes
CompressionLevel 9
User jdamery
FallBackToRsh no

 And a symlink from ~/bin/chiark -> /usr/bin/ssh

 However, I do suspect that most users of the feature are sysadmins of 
machines within the same administrative control and hence this will
not be needed.

 Jonathan.



More information about the openssh-unix-dev mailing list