Servers and cloud

Add a user and make them an admin

Create a new user account and give it admin (sudo) rights, or list the users you have.

Fill these in once
  1. Create an admin userNeeds sudo
    Terminal
    sudo sysadminctl -addUser alex -fullName "alex" -password - -admin

    It asks you to type the new user's password.

  2. List users
    Terminal
    dscl . list /Users | grep -v '^_'
  1. Create the userNeeds sudo
    Terminal · Ubuntu / Debian
    sudo adduser alex

    It asks for a password and a few optional details.

  2. Give them sudoNeeds sudo
    Terminal · Ubuntu / Debian
    sudo usermod -aG sudo alex
  3. List users
    Terminal · Ubuntu / Debian
    getent passwd | cut -d: -f1
  1. Create the userRun as administrator
    PowerShell
    New-LocalUser -Name alex -Password (Read-Host -AsSecureString "Password")
  2. Make them an administratorRun as administrator
    PowerShell
    Add-LocalGroupMember -Group Administrators -Member alex
  3. List users
    PowerShell
    Get-LocalUser