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.

David W.
  • 391
  • 3
  • 5
  • 15

1 Answers1

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.

Alex Holst
  • 2,240
  • 1
  • 15
  • 13