This is required for ssh as well as for autossh, simply because in a background run a passphrase cannot be entered interactively. Note 2: Make sure you use public/private key authentification instead of password-based authentification when you use -f. Note 1: Before you use autossh, make sure the connection works as expected by trying it with ssh first. Let’s take the basic example from part one of this article series (forwarding a remote MySQL port to my local machine on port 5000): ssh -L 5000:localhost:3306 can simply be turned into an autossh command: autossh -L 5000:localhost:3306 is basically it. Apart from that you can then use it just like you would use ssh to create any forward or reverse tunnels. The important part to remember is that -f (run in background) is not passed to the ssh command, but handled by autossh itself. V simply displays the version and exits. Note: Make sure to grab the latest version which can be found here. # cd /usr/ports/security/autossh/ & make install cleanĪlternatively you can also compile and install AutoSSH from source: wget ![]() How to install AutoSSH on various systems via their package manager. TL DR autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -L 5000:localhost:3306 fully configured (via ~/.ssh/config) for background usage autossh -M 0 -f -T -N cli-mysql-tunnelĪutossh is a program to start a copy of ssh and monitor it, restarting it as necessary should it die or stop passing traffic.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |