Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux 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!


  Search this Thread
Old 05-30-2009, 04:35 PM   #1
Allanitto Newbee
Registered: Oct 2007
Location: Montreal
Distribution: Slackware12;Slackware13
Posts: 106

Rep: Reputation: 15
Smile how to add additional more group to an existing user


How to add an existing user to a particular group like ftp?

Old 05-30-2009, 04:42 PM   #2
Registered: Apr 2006
Location: holland
Distribution: Gentoo / debian / suse / mint
Posts: 558

Rep: Reputation: 42
Too add an existing user to a group, use the following line, taking ftp group as an example:

usermod -Gftp puntjuh

where puntjuh is changed to the appropriate user and ftp to the appropriate group.

This will add the user to a new group.

If you want to change the users primary group, you use a non-capital g instead of the capital G.

Good luck!
Old 05-30-2009, 04:43 PM   #3
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Check out the man page for "adduser"
Old 05-30-2009, 11:20 PM   #4
Registered: Jul 2008
Location: Chennai, India
Distribution: RHEL5, Ubuntu
Posts: 191

Rep: Reputation: 37
usermod -G <secondary_group> <username>
eg.usermod -G sales saagar
This command has a problem...If you want to add one more secondary group to saagar, say culturals group, then
if we do
usermod -G culturals saagar,
and now if you type

id saagar,

then you will see only culturals as saagar's secondary group and sales is lost.
so i think follwing is the better way:

gpasswd -a saagar sales
gpasswd -a saagar culturals.

id saagar
now saagar will be in both sales and culturals secondary groups.
Old 05-30-2009, 11:55 PM   #5
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I think you guys may mean

usermod -a -G ftp user

or similar don't you?
Old 05-31-2009, 08:41 AM   #6
Allanitto Newbee
Registered: Oct 2007
Location: Montreal
Distribution: Slackware12;Slackware13
Posts: 106

Original Poster
Rep: Reputation: 15
Thanks guys,

They are really useful. I added my user to group ftp already with your help.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
add an existing user to an existing group? tramni1980 Slackware 5 05-08-2008 07:28 PM
howto add additional sas harddisk on existing RAID5 system taboo Linux - Newbie 2 10-24-2007 04:44 PM
Adding new group to existing user ALF Linux - Software 7 05-08-2006 09:35 PM
how to add an existing user to a new group? xpucto Linux - Newbie 8 04-19-2006 08:31 AM
add root user to the existing group ashley75 Linux - General 4 09-25-2003 09:40 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:22 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration