Skip to content

Instantly share code, notes, and snippets.

@Belval
Created May 16, 2018 19:32
Show Gist options
  • Save Belval/6906207f96a40325931a662b29d8c363 to your computer and use it in GitHub Desktop.
Save Belval/6906207f96a40325931a662b29d8c363 to your computer and use it in GitHub Desktop.
A script to setup autossh (server side)
# Create user tunnel
sudo useradd -m tunnel
# Enter some easy password (we'll flush it afterwards)
sudo passwd tunnel
read -p "Run the client script on your client now. When you're done, press [ENTER]."
# Delete tunnel user password
sudo passwd -d tunnel
# Remove access to the shell for this user
sudo usermod /sbin/nologin tunnel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment