Skip to content

Instantly share code, notes, and snippets.

@pensebien
Last active November 29, 2017 01:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pensebien/61553853044867f34273f5013d36a7f7 to your computer and use it in GitHub Desktop.
Save pensebien/61553853044867f34273f5013d36a7f7 to your computer and use it in GitHub Desktop.
How to add a new user on your Ubuntu Digital Ocean Droplet from a Git Bash Windows System

Adding a user to the System to allow control over the www.data (Web directory of your new droplet)

#############################################################

⋅⋅1. Log in to your server as the root user

`local$ ssh root@server_ip address e.g ssh root@204.55.34.84`

You can learn how to add SSH to your Windows's system from GIT BASH

⋅⋅2. You default to the adduser command on Linux to add a new user to your remote system

`local$ adduser **username**`

NB: Do not forget to change the username to your. E.g $adduser newbee

..*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]`

..3 Use the usermod command to add the user to the sudo group

`local$ usermod -aG sudo *username*`

By default, on Ubuntu, members of the sudo group have sudo privileges.

..4 Test sudo access on new user account

..* Use the su command to switch to the new user account

    `su - *username*`

..* For example, you can list the contents of the /root directory, which is normally only accessible to the *root user*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment