Created
November 26, 2019 01:29
-
-
Save iamdylanngo/a3d1ce2a18903d5db9505c6cf404d881 to your computer and use it in GitHub Desktop.
Install OpenSSH Server in ubuntu
This file contains hidden or 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
# 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