Skip to content

Instantly share code, notes, and snippets.

@royki
Last active November 29, 2020 20:40
Show Gist options
  • Save royki/e4123cd6d740ae6e9d2546b86f2815eb to your computer and use it in GitHub Desktop.
Save royki/e4123cd6d740ae6e9d2546b86f2815eb to your computer and use it in GitHub Desktop.
Linux Add user in sudo/wheel, Enable root user login

Add user to group and make sudoer/nopassword-access

Ubuntu

  • adduser username
  • usermod -aG groupname username or gpasswd -a user_name group_name
    • usermod -aG sudo username
  • visudo
    • username ALL=(ALL) NOPASSWD:ALL
  • Remove a user from a group
    • deluser user_name group_name or gpasswd -d user_name group_name

Centos

  • passwd username
  • usermod -aG wheel username
  • Adding user to group wheel
    • gpasswd -a username wheel
  • Check User wheel
    • sudo lid -g wheel

Enable Root User to Login

  • passwd root
  • Edit the file /etc/gdm3/custom.conf and put under [daemon] section AllowRoot=true
  • Commented the following line from the file /etc/pam.d/gdm-password
  • auth required pam_succeed_if.so user != root quiet_success

Change User and User dir, User group -> from user Y to user X

  • groupadd X
  • usermod -d /home/X -m -g X -l X Y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment