assh
assh copied to clipboard
Use uppercase letters in hostnames
When I put an entry with a hostname that contains uppercase letters to .ssh/assh.yml
,
hosts:
SomeHost:
User: someuser
it always gets lowered in .ssh/config
.
Host somehost
User someuser
Is there any way to set uppercase hostnames in .ssh/config
via assh?
I'm using assh 2.7.0 on macOS High Sierra.
Hostnames are not case sensitive, RFC-952.
At least they seem to be case sensitive to my OpenSSH client.
For example, when I put
Host github
User git
HostName github.com
to my ~/.ssh/config
, I can ssh github
, but cannot ssh Github
.
$ ssh github
PTY allocation request failed on channel 0
Hi muupan! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
$ ssh Github
ssh: Could not resolve hostname github: nodename nor servname provided, or not known
$ ssh -V
OpenSSH_7.6p1, LibreSSL 2.6.2
What you mean @muupan is the "Host github" entry not the actual Hostname that will be contacted. The "Host" basicly is just a string that dosn't have to do anything with the actual Hostname.
So if "$ ssh github" works, why don't you just use the lowercase host alias ;-)
So if "$ ssh github" works, why don't you just use the lowercase host alias ;-)
Because it is not me but a program written by others that executes ssh Github
.
Is there any reason for assh to prevent users from using uppercase letters in "Host"?
Additionally, you can end up in a situation where previously accepted host keys are no longer considered to match. For example, we have a system with hundreds of hosts which have hostnames containing uppercase characters. A script generates an ssh config file containing those host configs, and also sets about accepting the keys once confirmed to match. However, after switching to assh managed config file, "HOSTA" has become "hosta" and any attempts to ssh to hosta are now met with:
The authenticity of host 'hosta (
I don't understand the value in the forced-lowercase behavior. Is there any way to override this?