Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 8 down vote accepted

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.

share|improve this answer
    
Thanks. Works for me. –  David W. Apr 23 '12 at 4:06
    
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

 
discard

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.