Last active
December 1, 2019 05:49
-
-
Save Ruzzz/2504881170e8e72ba05e9bfc990c4bfe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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