bugzilla-daemon at mindrot.org
2022-Sep-29 04:37 UTC
[Bug 3477] New: Support environment variable or %u token for User
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.
bugzilla-daemon at mindrot.org
2023-Nov-15 07:11 UTC
[Bug 3477] Support environment variable or %u token for User
https://bugzilla.mindrot.org/show_bug.cgi?id=3477 --- Comment #1 from Ben Creasy <ben at bencreasy.com> --- I figured out how to make this work by using %r in the ProxyCommand and an environment variable using ${VARIABLE}. The %r is for remote user - I think it's configured in the bastion server or something? I don't have the ssh config handy since it's work related but I may reproduce it on my personal machine at some point. Ultimately I was able to make an ssh config with no hardcoded usernames, but I still think it would be useful and intuitive to allow for a variable in the User configuration itself. -- You are receiving this mail because: You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2024-Nov-06 13:58 UTC
[Bug 3477] Support environment variable or %u token for User
https://bugzilla.mindrot.org/show_bug.cgi?id=3477 H?kon Hallingstad <hakon.hallingstad at gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hakon.hallingstad at gmail.com --- Comment #2 from H?kon Hallingstad <hakon.hallingstad at gmail.com> --- I have the same need - to SSH to Azure, the username is the full email address so I would like to set the value to %u at domain , in a config file included by all in our organization. Is this a change that the maintainers would approve of, and if I add make the code changes, would anyone care to review this? -- You are receiving this mail because: You are watching the assignee of the bug.