LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 04-14-2008, 12:50 AM   #1
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Rep: Reputation: 30
useradd problem


Hi, i just installed VirtualBox on my Debian etch machine. It created a group named 'vboxusers'. When running VirtualBox command from a terminal so that it opens the GUI, i get a message that i am not part of that group. So, i evidently attempted to add the user to that group, using the following command:
adduser -G vboxusers my_user_name
Oddly enough, i get the error message below:
useradd: user ****** exists
Now, performing id 'my_user_name' in the console, i notice that the group vboxusers is not there, which means that i am not a member of that group.

Why is adduser telling me that user exists if i want to add my user to the group??

Thanks in advance for the help.
 
Old 04-14-2008, 01:58 AM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
You should use the usermod command, not useradd to change group membership.
 
Old 04-14-2008, 02:00 AM   #3
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Perhaps you meant to use usermod?
 
Old 04-14-2008, 12:49 PM   #4
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
Do you mean something like this?
usermod -a -G vboxusers my_user_name
 
Old 04-14-2008, 02:00 PM   #5
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
Quote:
Originally Posted by trebek View Post
<snip>adduser -G vboxusers my_user_name<snip>
Try the other way around without "-G": adduser your_user_name vboxusers
 
Old 04-14-2008, 02:04 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Quote:
Originally Posted by trebek View Post
Do you mean something like this?
usermod -a -G vboxusers my_user_name
Yes, although my version of usermod doesn't support the -a switch. What does it do on your system?
 
Old 04-14-2008, 03:46 PM   #7
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
man usermod

Quote:
-a, --append
Add the user to the supplemental group(s). Use only with -G option.

-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 -a
option, which appends user to the current supplementary group list.
 
Old 04-15-2008, 01:54 AM   #8
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
That's exactly what i read in the man page for usermod. The command typed in my previous post worked fine. I run an 'id' command on my username and the vboxusers is now listed. According to all the manuals that i found, using useradd was supposed to do the trick, but that's not true. Apparently, on my system, usermod is the way to go.

Thanks a lot for clearing that up for me, i appreciate it.
 
Old 04-15-2008, 05:52 AM   #9
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
You are confusing the useradd command with adduser. The latter allows you to add a user to a group. That is what makuyl said but no one paid attention.

It is either adduser username groupname, or adduser groupname username. Check the command line options.

jlinkels
 
  


Reply



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
useradd problem john83reuben Linux - Newbie 15 02-21-2008 11:17 PM
Useradd - Cannot locate /etc/default/useradd in Solaris Paean Solaris / OpenSolaris 4 12-09-2005 01:36 AM
useradd problem efanning Linux - Newbie 1 07-29-2004 07:24 PM
useradd problem scatcat Linux - Newbie 3 06-21-2002 03:33 AM
Problem with useradd wbheinkel Linux - Newbie 2 01-21-2002 05:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 07:12 AM.

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