[Bug 3477] New: Support environment variable or %u token for User

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Thu Sep 29 14:37:35 AEST 2022


https://bugzilla.mindrot.org/show_bug.cgi?id=3477

            Bug ID: 3477
           Summary: Support environment variable or %u token for User
           Product: Portable OpenSSH
           Version: v9.0p1
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: ssh
          Assignee: unassigned-bugs at mindrot.org
          Reporter: ben at bencreasy.com

While I realize most of the ~/.ssh/config files are bespoke, I'm trying
to write a shared one for my team.

Right now I'm just leaving the User field out which means that instead
of people typing ssh <server> they type ssh <user>@<server> - I'd like
to save them some keystrokes. Per
https://man.openbsd.org/man5/ssh_config.5#TOKENS and Env Variables
section ssh_config doesn't seem to support using a variable of any type
here.

However, I discovered that my Windows work computer using Git Bash for
Windows (https://gitforwindows.org/), ${USERNAME} was expanding to my
username properly for the User field. It says that it's running
OpenSSH_8.5p1.

On my Macbook Pro running OpenSSH_9.0p1 it didn't work - ${USER}
($USERNAME is a Windows thing) ssh <host> just gives me:
${USER}@<censored> Permission denied (publickey).

On my Macbook, I cloned down the repo from
https://github.com/openssh/openssh-portable and ran `git checkout
V_8_5_P1` and then compiled from source. Still didn't expand the
variable.

In looking at old bug/enhancement reports, I did notice
https://bugzilla.mindrot.org/show_bug.cgi?id=3140 which seemed to be
just about paths.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list