I'm looking for a DRY solution that would allow me bothssh server-aliasandping server-aliasI know the former is reading .ssh/config, and the latter /etc/hosts, but I'd rather not repeat the same aliases in both files. Is it a good idea to have a single source for both? If so, how can I accomplish it? I can simply omit HostName line from the .ssh/config entry, and it will be read from /etc/hosts, does this approach have any disadvantages? If so, what should I use instead? It's intended for a single-user laptop, and no host masking is required.
Single source for both .ssh/config and /etc/hosts
ssh;hosts
Yes. There is no need to clutter your .ssh/config with Hostnames if all you want is tab expansion.Entries in /etc/hosts will be sufficient..ssh/config is for specifying login names etc.Maybe you should use wildcards in your hostnames in .ssh/config if you really want to specify connection details there at all.http://linux.die.net/man/5/ssh_config