How to list user in Linux box, add an user to a group!
Linux - NewbieThis forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Depending on distro and desktop, you probably have several gui's to choose from.
Search the menu, or systems control-center (if any), or kde's controlcenter.
Or do it the manual way:
List users:
# cat /etc/passwd
Add user to a group: edit /etc/group Syntax is:
cdrom:x:22eterh,charles
The user of course has to exist or you'll have problems...
Re: How to list user in Linux box, add an user to a group!
Quote:
Originally posted by steady_lfcfan I have found for time but i still don' know how to list the user in my linux box, also how can I add an exist user to a group!
thank you, but this print all user includes system user (samba,apache ...)
Pingu, I am running Radhat box and I have not X installed, is there other way?
well I see many answered to the listing users,but not so clear answers to adding an existing user to a group (no offense); you can do this by using the "gpasswd -a user group" command.
I know my answer is only a few years late but for googling people it might be nice
That's dangerous, since it will REMOVE the user from all current groups and put them ONLY in the specified groups.
Quote:
Originally Posted by manpage
-G, --groups GROUP1[,GROUP2,...[,GROUPN]]]
A list of supplementary groups which the user is also a member of.
Each group is separated from the next by a comma, with no
intervening whitespace. The groups are subject to the same
restrictions as the group given with the -g option. If the user is
currently a member of a group which is not listed, the user will be
removed from the group. This behaviour can be changed via the -a
option, which appends the user to the current supplementary group
list.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.