Author Topic: Adding new user to sudoers list. [SOLVED]  (Read 1469 times)

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4889
  • Karma: 1058
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 10 (64-bit)
Adding new user to sudoers list. [SOLVED]
« on: February 16, 2015, 04:32:28 am »
Hi, I'm in the process of setting up Peppermint Five 32bit on my sister's and brother-in-law's computer.  My location is in Amsterdam NL and their location is the North of England - "where it be grim".  The whole process has be done remotely using the excellent, Team Vewer ;).  I want to have separate accounts for them both.  The second account is easy enough to make.  My issue is I cannot figure out how to give each account equally sudoer's privileges.  The answers from a web search are so varied and vague, it just becomes frustrating.  How do I do this from the CLI?  I will also be asked how to do this by using the Users & Group GUI.  Any pointers on how to do that too would be great.  Many thanks  ;).
« Last Edit: February 16, 2015, 05:34:24 am by AndyInMokum »
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26437
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Adding new user to sudoers list.
« Reply #1 on: February 16, 2015, 04:56:44 am »
Easiest way would be to make both accounts an "Administrator" in Users & Groups.

If you want to be more selective (in Users & Groups), you can select "Manage Groups", then scroll down to the "sudo" group and select Edit, and make sure both accounts are ticked



At the CLI (I must add it's probably safer doing it via the Users & Groups GUI .. see the warning below) -

You can see what groups the current user belongs to by running:
Code: [Select]
groupsor the groups for a particular user with
groups <username>
eg.
Code: [Select]
groups mark
to add a user to a group you'd run

sudo usermod -aG <group> <username>

WARNING - Be VERY careful not to miss out the -a (append) option .. if you do, it'll remove you from all other groups ;)

eg.
to add user "mark" to the sudo group:
Code: [Select]
sudo usermod -aG sudo mark


Creating a user from scratch in the CLI -

Create the account (including home folder) and add it to a list of groups:

sudo useradd -m <new-username> -G <group1>,<group2>,<group3>,<group4>,<etc.>

(note the groups are comma seperated but with no spaces .. see the example below)

Then create a password for the <new-username> account:

sudo passwd <new-username>

eg.

To add a new account called "administrator", and add it to a few groups:
Code: [Select]
sudo useradd -m administrator -G adm,tty,disk,lp,dialout,fax,cdrom,floppy,tape,sudo,audio,dip,backup,video,plugdev,syslog,fuse,lpadmin,nopasswdlogin,netdev,ssh,sambasharethen you need to create a password for the new administrator user:
Code: [Select]
sudo passwd administrator
« Last Edit: February 16, 2015, 05:39:59 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4889
  • Karma: 1058
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 10 (64-bit)
Re: Adding new user to sudoers list.
« Reply #2 on: February 16, 2015, 05:33:36 am »
That's perfect.  I can finish setting up their computer now - thanks a bunch  ;)!!

Team Viewer really is the business  8).
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26437
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Adding new user to sudoers list. [SOLVED]
« Reply #3 on: February 16, 2015, 05:37:33 am »
You're welcome :)

Yeah, IMHO Teamviewer is about the best app of its kind .. easy to install, easy to use, and multi platform
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec