Beyond SSH Bookmarks

December 9, 2010
190px-openssh_logo-1

I tripped over an article > this week on creating "SSH Bookmarks", which are basically aliases for hostnames within your ~/.ssh/config file.

I think this is pretty cool, but I’ve been doing something I think is superior for a while now: Bash aliases for the entire SSH command.

So while the SSH Bookmark idea has us typing the following:

# ssh bookmark

ssh server

…which is easier than ssh daniel@host.domain.com…why not just use a bash alias and type a single character?

# bash alias

s

That’s one key (not counting enter). And if you’re worried about collisions with existing commands, make it two characters…or three, etc.

Even better, if you use SSH keys1 this can drop you right to a prompt without even entering a password on the server side. So yes, SSH bookmarks are pretty cool, but if we’re making the effort to reduce keystrokes, why not utilize what’s available and go all the way? ::

Notes

1 If you’re going for the instant shell access, i.e. not having to enter a password on the server side, you need to either have a password on your SSH key or be dropping in as a non-root user. Don’t easy yourself into stupid.2 The alias within .aliases looks like so: alias b="ssh daniel@host.domain.com"

supporting = loving

For 29.455 years I've been creating ad-free technical tutorials and essays here — 3,029 pieces and counting. It's a one-person effort that's also my life and livelihood. If it makes your day more livable in any way, please consider supporting the work with a monthly or one-time donation. Your support means a lot to me, and makes all the difference. 🫶🏼