Skip to content

Instantly share code, notes, and snippets.

@Ruzzz
Last active December 1, 2019 05:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
# On remote host do:
# ------------------
# Add user
sudo adduser <USER> sudo
# Or:
sudo adduser <USER>
sudo usermod -a -G sudo <USER>
# Change ssh configuration
sudo nano /etc/ssh/sshd_config
# Port NNN
# PermitRootLogin no
# AllowUsers <USER>
sudo service ssh reload
# On local host do:
# ------------------
# Generate key
ssh-keygen -t rsa -b 4096 -f <KEY_FILE>
# Copy public key to remote host
ssh-copy-id -i <KEY_FILE> <USER>@<HOST>
# Connect to remote host
ssh -i <KEY_FILE> <USER>@<HOST>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment