Skip to content

Instantly share code, notes, and snippets.

@iamdylanngo
Created November 26, 2019 01:29
Show Gist options
  • Save iamdylanngo/a3d1ce2a18903d5db9505c6cf404d881 to your computer and use it in GitHub Desktop.
Save iamdylanngo/a3d1ce2a18903d5db9505c6cf404d881 to your computer and use it in GitHub Desktop.
Install OpenSSH Server in ubuntu
# In server
sudo apt install openssh-server
sudo vim /etc/ssh/sshd_config
- Edit sshd_config change to
PasswordAuthentication no
sudo service ssh restart
sudo ufw allow ssh
# In client
ssh-keygen
cd .ssh
cat id_rsa.pub
- Copy public key
# In Server
- ssh for user
echo "public_key_string" >> /home/<user>/.ssh/authorized_keys
- ssh for root
echo "public_key_string" >> /root/.ssh/authorized_keys
sudo service ssh restart
# In client
ssh <user>@<serverIP>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment