As an example: I'd love to run `set -o vi` on every ec2-user login, but the machines tend to be ephemeral and this command might not be wanted by other users, so I don't add it to /etc/profile or /etc/bashrc.
Why wouldn't you put that in ~/.bashrc ?
What if you don't have a home directory on an ephemeral server?
Then you won’t have anywhere to store ~/.ssh/rc, and the version you’d put in /etc would still unfortunately apply to all users.
Your ssh rc is stored locally, to be executed on remote servers, right? Locally you have a home dir, but you don't on the remote.
No, it lives on the server.
The ec2-user is shared by all users who might login; our EC2 hosts usually only last a few minutes/hours and are only accessed during debugging or extraordinary circumstances.
The .ssh/rc file goes on the server though, so you’d still have that problem.
allows you to use vi on the command line for anyone else who was wondering.
okay? If i'm wrong, what's it for?
It could be worded better. It allows you to use vi style keybindings when editing a line in bash. By default bash uses emacs style keybindings. It doesn't actually use vi.
thanks.
If you run a terminal multiplexer like byobu you may want to run it only for the ssh connection, not for every sub-shell (otherwise you may get a warning about running a multiplexer inside another multiplexer session).
`w` on multi-user machines that you're logging into to debug, so you can see who's on it and when they were last active.
You can automatically (re)start tmux so your sessions survive losing a connection.