Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 2515

Raspberry Pi OS • Re: Create a new user with copied privilegues

$
0
0
Putting the user in the "sudo" group will allow the use of sudo, but will require the user's password to be entered. If you want the user to be able to use sudo without a password you'll need to update the sudo configuration.

The sudo configuration for the normal user is in /etc/sudoers.d/010_pi-nopasswd. You could add the new user to that file or create a new file. Be careful when doing this as any mistake could render sudo unusable.
But listing the groups uses " " as seperator, while the usermod command uses "," as seperator.
So change them? There are many tools that could take the output of the "groups" command and "tweak" it for you. The basic "tr" command can replace a set of characters with another set of characters:

Code:

rpdom@raspi16:~ $ groups | tr " " ","rpdom,adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,input,render,netdev,docker,gpio,i2c,spi
But you'll probably want to remove that first group as it belongs to that user. Maybe sed?

Code:

rpdom@raspi16:~ $ groups | sed "s/rpdom //;s/ /,/g"adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,input,render,netdev,docker,gpio,i2c,spi

Statistics: Posted by rpdom — Wed Oct 09, 2024 9:28 am



Viewing all articles
Browse latest Browse all 2515

Trending Articles