Re: user@host configuration in ~/.ssh/config



<dtucker@xxxxxxxxxxxxxxxx> wrote in <43cceb2c$0$23536$5a62ac22@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>:
> On 2006-01-17, Stein Arne Storslett <sastorsl@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
>> I am aware that I can use aliases for the host, and thus achieve what I
>> want by having different aliases for different users (much the same as
>> you can do with .netrc and ftp), but this requires that you have to edit
>> in more than one file, and you need to have access to the /etc/hosts
>> file.
>
> Why do you need to edit /etc/hosts for that? The following ought to work:
>
> Host host-user1
> Hostname host
> User host
> IdentityFile ~/.ssh/id_dsa_user1_host
>
> ... and so on.

DAMN, i didn't know this!
So when I do a "sftp user1-host" SSH actually does not do a DNS query
until it has checked the config file?
Well, it is something like that or other, because I just tried it, and
it worked.

I thought that the <host> part of "Host <host>" _had_ to be a real
hostname.

I see now from the man-page of ssh_config:

HostName
Specifies the real host name to log into. This can be used to
specify nicknames or abbreviations for hosts. Default is the
name given on the command line. Numeric IP addresses are also
permitted (both on the command line and in HostName
specifications).

Thank you very much for clearing this up for me.


Allthough I would really find a <user>@<host> syntax in the Config file
more intuitive.

Maybe:

Host <host>
UserOpts user1
IdentityFile=...
ForwardX11 no
UserOpts user1
IdentityFile=...
ForwardX11 yes

Oh well...

--
Stein Arne
.



Relevant Pages