To correctly stop an autossh running process use the following (taken from https://superuser.com/a/1008029):
sudo pkill -3 autossh
To correctly stop an autossh running process use the following (taken from https://superuser.com/a/1008029):
sudo pkill -3 autossh
You would like to use autossh to keep a connection open (ie database) between two hosts, but while the ssh equivalent command to start a tunnel works, the autossh does not.
You might be seeing the following errors (using AUTOSSH_DEBUG=1):
autossh[7471]: ssh exited prematurely with status 255; autossh exiting
or if you look at /var/logs/syslog you could also see entries like the following:
apparmor="DENIED" operation="open" profile="snap.autossh.autossh" name="/home/autossh/.ssh/id_rsa.pub" pid=7447 comm="ssh" requested_mask="r" denied_mask="r" fsuid=1002 ouid=1002
You have used snap to install autossh which is not allowed by apparmor.
Remove the snap package and install autossh as a normal debian package:
sudo snap remove autossh
sudo apt install autossh