map remote ssh user to a different local user

All my boxes have the same username for myself, except one legacy machine where I'm loath to try to change it. Whenever I ssh to the machine, I forget to specify my user name, and my password is rejected. This only takes maybe 30 seconds, but it should only take 3, so it's a PIA.

Is there any way to configure that machine to recognize the incoming username and map it to another, correct, one?

I'd really like to configure this on the server itself if possible. Configuring each client is less ideal, especially since I like to muck with my various installations and VM's quite a bit.


Solution 1:

In your ~/.ssh/config:

host otherhostname
user otherusername

Then it'll use otherusername when you $ ssh otherhostname.