Tuesday, February 7, 2017

SSH typing password only once

In order to type the SSH password only once, and not have to type it again during the active session in your local computer, you need to enable multiple sessions over a single connection in ~/.ssh/config:

host *
    controlmaster auto
    controlpath /tmp/ssh-%r@%h:%p
    ControlPersist yes


Source.


If your connection crashes and you are not kicked out of it, your stuck connection process will lie around your system, not connection and not allowing you to create a new connection. You can either reboot the computer (dumb way) or kill the process. You can perform the second method by following the steps:

Run the following command and identify the PID (Process ID) of the connection (it's the first column of numbers):
ps -aux | grep ssh

Kill the process:
kill <PID>