Hacker News new | ask | show | jobs
by hsbauauvhabzb 855 days ago
Use ~/.ssh/config to add per host or wildcard values for port :)
4 comments

~/.ssh/config is one of the simplest, most useful features I use on a daily basis. It would be easy to accomplish much of it's behavior even if it didn't exist (bash script for each account@host), but it wouldn't be as elegant.

The config-aware shell completion is especially cool.

My most recent pet hate is inability to instruct scp to ignore symlinks -.-
Huh. You're right, and it's a WONTFIX: https://bugzilla.mindrot.org/show_bug.cgi?id=485.

I hadn't even noticed, because I tend to automatically reach for rsync instead, even for single files.

Interestingly enough that ticket is about preserving and/or following - I would be happy with ignoring so it doesn’t end up in an infinite loop - as it stands a self referencing symlink with files in the same directory will result in either your disk filling up, your inodes filling up, or a maximum bested paths error (assuming your FS has such a thing).

Edit: and until the ticket you just linked, I assumed scp and cp were intended to be close equivalents, given the whole ending in ‘cp’ thing.

This right here is the next big trick behind using CTRL+R to find the last ssh command.
Great if you only ever ssh from your primary box/profiles, an amplifier of the problem (due to entering the commands less often) otherwise!
I use this for aliasing as much as for Port assignment.