PDA

View Full Version : how to list of Groups on ubuntu server



vaibhavsd
September 27th, 2010, 02:58 PM
how to list of Groups on ubuntu server,


and how to create user on ubuntu server

quixote
September 30th, 2010, 04:12 AM
cat /etc/groupwill list all the groups, including ones used only by the system. Just typing
groupswill list all the groups of which the current user is a member. To add a user use
sudo useradd name To add a user to a specific group use
sudo usermod -G name-of-group -a 'name-of-user'

For more information on all these -- and it's really a good idea to make sure you know what you're doing before doing system-level commands -- you can type
info command-name or
man command-name For instance "man useradd".

toofun
September 20th, 2012, 04:45 PM
I did this without adding the -a option so now I no longer have root access, and oddly enough the admin group is no longer in the /etc/group file. Does anyone know how to recover from such a scenario? The link:
http://ccollins.wordpress.com/2007/07/02/restore-default-ubuntu-groups/

talks about a similar situation but does not talk about how to add the admin group back into the /etc/group file. It's easy to edit back in but what number do you assign it?

matt_symes
September 20th, 2012, 04:52 PM
This is a really old thread. Closed. Please start a new thread.