Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm not sure if this has a practical application at all (aside from the fact that I am lazy. you know "christopher" has 11 characters, and I want to type 1), but is it possible to alias a username on Linux? (So I could, for example, ssh as opposed to ssh

I currently use Ubuntu as my primary machine, but if it is possible in any of the distro's, I'd like to know.

share|improve this question
Are you only interested in a shorter ssh command, or do you want this more generally? – Daniel Beck Dec 13 '11 at 18:28
up vote 26 down vote accepted

Create a file named ~/.ssh/config and put this in there:

Host h
User christopher

Now you only have to type ssh h and it does the same thing!

You can also use a wildcard:

Host *
User christopher
share|improve this answer
If you do define it with Host * it should be done at the end of the configuration file, so other more specific settings can take precedence. – Zoredache Dec 13 '11 at 23:02

You could create a second user, c, with the same UID. From here:

The UID is the actual information that the operating system uses to identify the user; usernames are provided merely as a convenience for humans. If two users are assigned the same UID , UNIX views them as the same user, even if they have different usernames and passwords. Two users with the same UID can freely read and delete each other's files and can kill each other's programs. Giving two users the same UID is almost always a bad idea; we'll discuss a few exceptions in the next section.

Chapter 4.1.2 explains when it might be useful. This is not one of the suggested use cases though!

share|improve this answer

For the ssh specific case: if your username is the same on both machines you can omit the username completely.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.