LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   how to add user to sudoers (https://www.linuxquestions.org/questions/debian-26/how-to-add-user-to-sudoers-4175688721/)

00x 01-17-2021 12:45 AM

how to add user to sudoers
 
How do I allow a user to use sudo?
This is what I have tried:
Code:

cia@TRRNTS:~$ su
Password:
root@TRRNTS:/home/cia# /usr/sbin/visudo
[...]
# Allow members of group sudo to execute any command
sudo    ALL=(ALL:ALL) ALL
[...]
root@TRRNTS:/home/cia# /usr/sbin/usermod -a -G sudo cia
root@TRRNTS:/home/cia# id cia
uid=1000(cia) gid=1000(cia) groups=1000(cia),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),109(netdev),112(bluetooth),115(scanner)
root@TRRNTS:/home/cia# exit
exit
cia@TRRNTS:~$ id
uid=1000(cia) gid=1000(cia) groups=1000(cia),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),109(netdev),112(bluetooth),115(scanner)
cia@TRRNTS:~$ sudo ls
[sudo] password for cia:
cia is not in the sudoers file.  This incident will be reported.
cia@TRRNTS:~$


ondoho 01-17-2021 01:06 AM

Strange, in my /etc/sudoers it reads "%sudo", not just "sudo". Using only "sudo" would mean the user sudo I guess?

In any case, user & group changes don't take effect until you log out/in iirc.

00x 01-17-2021 01:08 AM

Quote:

Originally Posted by ondoho (Post 6208602)
Strange, in my /etc/sudoers it reads "%sudo", not just "sudo". Using only "sudo" would mean the user sudo I guess?

In any case, user & group changes don't take effect until you log out/in iirc.

that typo was the problem, thanks

ondoho 01-17-2021 01:44 AM

Quote:

Originally Posted by 00x (Post 6208603)
that typo was the problem, thanks

Mark it SOLVED please - see my signature.


All times are GMT -5. The time now is 11:01 AM.