1

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:

and

$ 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.

1 Answer 1

8

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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .