SSH User Annoyance & Solution

I’m in an environment where whenever I ssh to a machine I have a different username than that of my main machine. For example, the username on my desktop of “Some.Desktop.User,” whereas all the Linux environments I ssh to use the username “Some.Linux.User.” I’ve typed “ssh <host>” countless times, only to be annoyed when I realize that the password I am being prompted for is for “Some.Linux.User,” which does not exist on the host. Of course I should have typed “ssh <host> -l Some.Linux.User.”

To make life a little easier, do this:

In ~/.ssh create a file named config. In that file add the following:

Host *
User Some.Linux.User

Likewise, if you have a number of different accounts on different servers, you can do something like this:

Host servername.domain
User Some.Linux.User.1

Not exactly a super secret tip, but a useful time saver.

2 thoughts on “SSH User Annoyance & Solution

Comments are closed.