Command lines to create new ubuntu users?
jpcc at bigfoot.com
Tue Nov 13 20:47:01 UTC 2007
Charlie Zender wrote:
> How do I create fully Ubuntu user accounts with a traditional UNIX
> 'useradd' command? When I add new users via the Kubuntu
> system/users&groups menu-driven interface, the users have, by default,
> full access to the system hardware such as the sound interface.
> But new users whom I add with the command-line 'useradd' command,
> sudo useradd -c 'User' -d /home/user -g group -m -u userid user
> do not have access to, e.g., the computer sound chip.
> For example, they cannot start the audio mixer kmix.
> I think there should be a command line equivalent to all GUI actions,
> so what command-line programs and switches (e.g., useradd) will create
> the same 'user priveleges' (sound devices, CD access, etc.) for new
> users as the menu-driven interface?.
You just need to add the new user to the appropriate groups.
When logged in as you, type "groups" at the shell to see which groups
you are in. For me, this gives:-
johncc adm dialout cdrom floppy audio dip backup video plugdev users
scanner netdev lpadmin powerdev admin fuse vmware vboxusers
Debian users get a primary group created with the same name as their
username. The adduser command does this automatically, I believe.
I'm not sure what all the other groups do -- some are obvious like
"audio" and "video", some less so like "dip".
So your command line would be:-
sudo adduser bob
sudo adduser bob audio
sudo adduser bob video
.. etc ..
There may be a readymade way to add a user to multiple groups in one hit
(or you could easily script it).
Hope this helps.
More information about the ubuntu-users