DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
New user not assigned to any groups by default?
I just finished another installation of Debian Lenny on a desktop machine. I do not often install Debian from scratch on a desktop, usually it is an upgrade and then I am not confronted with this problem.
When I add myself as user, I am only assigned to the 'user' group. But I need to be member of a whole lot of more groups, like audio, video, scanner, cdrom etc.
Most other users get logged in thru NIS, and if they exist, it is no problem. But I am myself always an ordinary user to be able to get in in case NIS is down.
Just out of curiosity: is it really needed to assign new users to all groups? Unfortunately, that means even so many useradd commands as this group add command takes only one group at a time. Is there a setting somewhere to determine the default groups (plural) for a new user? Or should I simply write a small script and take life as it is?
It looks like a wrapper script is the way to go. On my system, the man page for useradd describes the /etc/default/useradd file, but it doesn't seem to have a groups entry. When I run useradd -D to see the defaults, there is one for GROUP, but not GROUPS.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Original Poster
Rep:
Correct.
With adduser, you can assign the user to one group during creation and then to one groud at a time.
With useradd you can assign the user to more groups during creation but not afterwards.
In the adduser man page it is mentioned that a custom script can be run, but there are no further explanations, neither in the adduser man page, nor in the adduser.conf man page.
You confirm my idea about a wrapper script, server based so I can access it from every machine.
After writing my original question I was wondering how e.g. Ubuntu handles this. Obviously it will be a GUI based tool, and I cannot imagine that the admin has to include the user in groups like audio etc. I should peek at an Unbuntu machine as well.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.