Hi, I couldn't find any description of the rule for choosing a right username when many usernames are provided from the command line/config file: It seems that usernames provided with -l and ...@ override the ones from config and "-o user", and the last one is chosen. I am not sure if this is a documentation issue or a bug. Examples: --------- 1. "-o" overrides .ssh/config ----------------------------- gbajson@server1:~$ cat .ssh/config Host localhost user=user_config gbajson@server1:~$ ssh -o user=user-o localhost user-o@localhost's password: 2. "-l" and "@" override "-o user" ---------------------------------- gbajson@server1:~$ ssh -l user_minus_l localhost user_minus_l@localhost's password: gbajson@server1:~$ ssh user_at@localhost user_at@localhost's password: 3. The last username is chosen when, both "-l" and "@" are provided ------------------------------------------------------------------- gbajson@server1:~$ ssh user_at@localhost -l user_minus_l user_minus_l@localhost's password: gbajson@server1:~$ ssh -l user_minus_l user_at@localhost user_at@localhost's password: Kind regards, Grzegorz
ssh_config(5) has this at the top: ssh(1) obtains configuration data from the following sources in the fol- lowing order: 1. command-line options 2. user's configuration file (~/.ssh/config) 3. system-wide configuration file (/usr/local/etc/ssh_config) does that help?
This bug is already filled as bug #2385, but I consider both of them resolved by the commit mentioned in the other one: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/sshconnect.c.diff?r1=1.260&r2=1.261
Darren, this helps but doesn't explain cases (2) and (3). Jakub, in fact this one is a duplicate. Thank you both.
*** This bug has been marked as a duplicate of bug 2835 ***
closing resolved bugs as of 8.6p1 release