Attach to the tmux session over SSH to continue your work.
Tag: OpenSSH
How to remotely execute shell function
Sometimes it is very convenient to define shell function and execute it remotely.
Use simple shell function to instantly create known_hosts entries for specified host, including its IP address and remove outdated public host keys.
Global known_hosts
file located in /etc/ssh/ssh_known_hosts
and user managed ~/.ssh/known_hosts
contains known host public keys. Due to its nature these files can contain multiple entries using the same key. It is not a problem, but merging entries using the same key is the first step that is necessary to inspect it visually and to verify host entries.
How to disconnect idle SSH clients
Disconnect idle SSH clients using built-in client alive mechanism.
There are rare cases when known hosts file becomes corrupted, so basic ssh utilities fail within custom built shell scripts due to ~/.ssh/known_hosts is not a valid known_hosts file
error.
From time to time I have to update passwords used to secure private keys to keep myself a bit more sane.
I will demonstrate simple and straightforward way to accomplish this task.
Sometimes I want to access a private server at home from a different network while being on the go.
The easiest way to do this is to use autossh utility to create a secure and persistent reverse SSH tunnel to the publicly available server.