Created
January 20, 2018 05:24
-
-
Save davigmacode/d09ae6bb9d10325b2e1813585a0f6fb5 to your computer and use it in GitHub Desktop.
add new user ubuntu and setup ssh keys
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
| // Log in to your server as the root user. | |
| local$ ssh root@server_ip_address | |
| // Use the adduser command to add a new user to your system. | |
| // Be sure to replace username with the user that you want to create. | |
| # adduser username | |
| // Set and confirm the new user's password at the prompt. A strong password is highly recommended! | |
| Set password prompts: | |
| Enter new UNIX password: | |
| Retype new UNIX password: | |
| passwd: password updated successfully | |
| // Follow the prompts to set the new user's information. | |
| // It is fine to accept the defaults to leave all of this information blank. | |
| User information prompts: | |
| Changing the user information for username | |
| Enter the new value, or press ENTER for the default | |
| Full Name []: | |
| Room Number []: | |
| Work Phone []: | |
| Home Phone []: | |
| Other []: | |
| Is the information correct? [Y/n] | |
| // Use the usermod command to add the user to the sudo group. | |
| // By default, on Ubuntu, members of the sudo group have sudo privileges. | |
| # usermod -aG sudo username | |
| // add ssh keygen | |
| - generate ssh keygen | |
| - copy public key to authorized_keys | |
| - reload sshd | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment