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 you'll probably want to remove that first group as it belongs to that user. Maybe sed?
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.
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:But listing the groups uses " " as seperator, while the usermod command uses "," as seperator.
Code:
rpdom@raspi16:~ $ groups | tr " " ","rpdom,adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,input,render,netdev,docker,gpio,i2c,spi
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