SSH configuration: override the default username
ssh, ssh-config, unix
Solution
Create a file called `config` inside `~/.ssh`. Inside the file you can add:
Host *
User buck
Or add
Host example
HostName example.net
User buck
The second example will set a username and is hostname specific, while the first example sets a username only. And when you use the second one you don't need to use `ssh example.net`; `ssh example` will be enough.
Problem
Is it possible to configure `ssh` to know what my username should be? By default it uses the current username, which is not correct in my case. I'm on a loaner laptop, and my username is `loaner`, but I want to tell `ssh` that my username is `buck`. Bonus points: my username at home is bgolemon. If I could configure the username per-host that would be even better.