On my desktop machine, my account is david, but on my servers it's dweintra. This means whenever I use scp I have to do this:

$ scp some.file dweintra@app05:


$ ssh dweinta@app05

I'd like to be able to simply do this:

$ scp some.file app05:
$ ssh app05

That is, somehow create an davidalias user name to my actual dweintra user name. I figure i could do this by putting an entry in the /etc/passwd file that matches the dweintra entry except of course for the first field of the line.

The dweintra is actually in NIS and not directly in /etc/passwd. Would there any problems doing this?

I'm just hoping to cut down on a few keystrokes and the few brief milliseconds it takes for me to pull what my user name is on the server.


Tell your ssh client which username to use when connecting to remote hosts. Put this in .ssh/config on your workstation:

Host *
User dweinta

I recommend you read all of the man page for ssh_config while you're at it.

  • On the Mac, it's User and not Username. Probably a BSD vs. Linux thing. – David W. Apr 23 '12 at 16:45
  • Nope, that was just me remembering wrong. Fixed. – Alex Holst Apr 23 '12 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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