Created
March 25, 2021 05:37
-
-
Save daubac402/33cfd58970b48b3499df481af3a6bfb6 to your computer and use it in GitHub Desktop.
Add and new user for SSH
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
$ sudo useradd new_user | |
$ sudo passwd new_user | |
# Create new_user key pair, then add public key into that user's authorized_keys | |
$ sudo mkdir /home/new_user/.ssh/ | |
$ sudo vim /home/new_user/.ssh/authorized_keys | |
# And permission | |
$ sudo chown new_user:new_user -R /home/new_user/ | |
$ sudo chmod 700 /home/new_user/.ssh/ | |
$ sudo chmod 600 /home/new_user/.ssh/authorized_keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment