Are ssh login aliases possible?

When I try to ssh into my Linode, I have a habbit of typing my user name for another server, but this is not the user name I use for my Linode. I needed my current user account to match up with my mail server configuration, and I don't want to change my mail server around because I now use my Linode's email account for some of the services I need that require an email address, some of which actually use email.

What I'm hoping to do is setup my Linode's ssh so that I can type type, e.g., "" and log in as "" (of course my domain isn't! couldn't resist :lol: ). Of course, I'd still use the same password (or, in my case, the same ssh key) because ssh would be pointing to the correct account.

Is this possible? So far, Google has been showing things from people saying they aren't sure this is possible, or going into security issues (which I already know about), but not actually setting this up.

10 Replies

Your ~/.ssh/config file can be used to set up aliases for user@host. So instead of doing ssh urmom@urdog.urcat, I can just do ssh urmom. man ssh_config for details.

Of course sharing user credentials across boxes/domains is considered a BAD security idea by most.

Is it REALLY? that hard to remember unique logins? Maybe you should just give it up and buy a fingerprint reader so you don't have to remember anything except where you left your hands.

I CAN'T FIND MY HANDS!!! Have you seen them? :(

If using the same login name is bad security, then I'm really setting myself up for attack, and I have a lot of work to do to correct that, including an intensive google search because I've been through a LOT of places in the past years… :)

Using the same login name isn't really a security risk. The user name I use ssh'ing to my Linode happens to be my real life name, and I can't be the only guy who spells it "kris" :) Sure, Piki may be a pretty unique name (which is why I chose it), but that doesn't prevent others from using it, so there's no guarantee that a Piki on another site is the same Piki as me, that Piki could be a girl! :) It's much more important to have a secure password and to have that password encrypted using a strong encryption method before sending it across a network. I've taken that two steps further and have required RSA keys via ssh and I changed the port, in addition to using strict iptables (which should be done regardless).

The only really reason I want to have the user alias setup is purely a matter of habit -- Piki has been my default handle for a couple years now, so it's automatic that I type Piki whenever I go to login anywhere, and it's annoying that I keep getting kicked out because I don't have a Piki on my server. Of course, I could just create a new user, but I'd still keep my old user for emails, and I have no other use for two users for myself other than making ssh easier, so that'd be useless for me.

Why not save yourself the trouble of typing the username at all:



User blah

Port 25000

I actually did that last night, and it does make things much easier, though I may find myself booting from CD soon (hard disk may die soon :( ) because my flash drive would be too small for a Linxu installation and all my files (not putting them on my Linode, I don't have enough bandwidth, and I'm too lazy to re-upload my files after changing them :) ). Of course, I could reformat my flash drive to FAT32 and use Putty Portable via WINE, but I'm too lazy for that too :)

Eventually, if user aliases aren't possible, I'll get used to the new user name, I was just born lazy, so I don't want to do that :lol:

You could write your username on a post-it note and put it on your monitor, which should suffice until your new hard drive arrives and you restore from backup. You could also order a new hard drive now, which might make the downtime brief enough that your post-it note won't need to be taped. -rt (it's how I keep my root passwords together)

I'm not forgetting my user name, I'm just typing the old one out of habit. The post-it would just get in the way anyway since I use a laptop, and there's hardly any room to post it.

Ordering the hard disk now isn't an option since I lost my job recently and I need to devote my remaining money to more important things (and since I can use a live CD and store my files on a flash drive, a hard disk isn't too important right now). Hopefully job search doesn't take long.

It may be possible to create a new username with the same UID, though I wouldn't be surprised if this confuses some applications. If you go this route, useradd -o seems like a safer option than editing /etc/passwd directly as Aaron describes.


I found your hands. They were mushing a dogsled team in northern Ontario, Canuckistan. You really should put stings on them or something.

All your hands are belong to us


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct