LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-29-2010, 07:09 AM   #1
cola
Senior Member
 
Registered: Sep 2007
Posts: 1,045

Rep: Reputation: 65
What's the command to add these groups to user account?


What's the single command to add these groups to user account?
Code:
users floppy audio video cdrom plugdev power netdev
Suppose user account "myuser" is already created with only "users" group.
 
Old 01-29-2010, 07:18 AM   #2
cola
Senior Member
 
Registered: Sep 2007
Posts: 1,045

Original Poster
Rep: Reputation: 65
Is it ok?
Code:
usermod -G floppy audio video cdrom plugdev power netdev <useraccount>
 
Old 01-29-2010, 07:18 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
usermod -a -G

Look at the man page for details
 
Old 01-29-2010, 07:19 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by cola View Post
Is it ok?
Code:
usermod -G floppy audio video cdrom plugdev power netdev <useraccount>
You need the -a flag
 
Old 01-29-2010, 07:20 AM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Did you looked at
man usermod ?
 
Old 01-29-2010, 07:21 AM   #6
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
Code:
usermod -G users,floppy,audio,video,cdrom,plugdev,power,netdev myuser
 
Old 01-29-2010, 07:24 AM   #7
cola
Senior Member
 
Registered: Sep 2007
Posts: 1,045

Original Poster
Rep: Reputation: 65
Reinstalled system.
man usermod
Code:
bash: man: command not found
Missing some packages.
 
Old 01-29-2010, 07:28 AM   #8
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
Install

man
man-pages
groff
 
Old 01-29-2010, 08:00 AM   #9
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Don't use usermod, I believe it may be dangerous.

Instead do:

Code:
for group in users floppy audio video cdrom plugdev power netdev; do gpasswd -a $USER $group; done
Then make sure to reload messagebus:

Code:
/etc/rc.d/rc.messagebus reload

Last edited by H_TeXMeX_H; 01-29-2010 at 08:03 AM.
 
Old 01-29-2010, 08:40 AM   #10
cola
Senior Member
 
Registered: Sep 2007
Posts: 1,045

Original Poster
Rep: Reputation: 65
Quote:
Originally Posted by H_TeXMeX_H View Post
Don't use usermod, I believe it may be dangerous.

Instead do:

Code:
for group in users floppy audio video cdrom plugdev power netdev; do gpasswd -a $USER $group; done
Then make sure to reload messagebus:

Code:
/etc/rc.d/rc.messagebus reload
Thanks for your suggestion.
I will go for gpasswd -a.
 
Old 01-29-2010, 09:17 AM   #11
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 293Reputation: 293Reputation: 293
Quote:
Originally Posted by cola View Post
Thanks for your suggestion.
I will go for gpasswd -a.
I would use gpasswd also. Just see "man gpasswd" for the details. The syntax is:
Code:
gpasswd -a user group
where user is the user name you want to modify, and group is the group(s) you want to add the user to.
 
Old 01-29-2010, 09:31 AM   #12
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,098

Rep: Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175
you can add an user to a predefined set (that nearly match yours) also when you create the account with adduser.
after selecting user's main group ("users" by default) you are presented a prompt in which you have to input additional groups
Code:
Additional UNIX groups:

Users can belong to additional UNIX groups on the system.
For local users using graphical desktop login managers such
as XDM/KDM, users may need to be members of additional groups
to access the full functionality of removable media devices.

* Security implications *
Please be aware that by adding users to additional groups may
potentially give access to the removable media of other users.

If you are creating a new user for remote shell access only,
users do not need to belong to any additional groups as standard,
so you may press ENTER at the next prompt.

Press ENTER to continue without adding any additional groups
Or press the UP arrow to add/select/edit additional groups
:
if you press the up arrow the prompt is filled with a set of default group for having a comfortable slackware desktop experience.
 
Old 01-29-2010, 12:18 PM   #13
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
I'd just use vigr(8) and add them to /etc/group manually. :-)
 
Old 01-30-2010, 04:39 AM   #14
Dinithion
Member
 
Registered: Oct 2007
Location: Norway
Distribution: Slackware 14.1
Posts: 446

Rep: Reputation: 59
Quote:
Originally Posted by rworkman View Post
I'd just use vigr(8) and add them to /etc/group manually. :-)
Me too. My memory stinks, so I'm never able to remember those commands, and it's faster for me to just edit with vigr, then to read one or two manpages.
 
  


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
How to add/remove groups with user? cola Slackware 6 12-28-2009 02:16 PM
"To add a new user account, log in to the root account" how do i do this (im new) pierce77x Linux - Newbie 4 12-28-2008 02:44 PM
samba - add user script - User account does not exist itzamecwp Linux - Server 2 01-18-2007 10:52 PM
What groups to add a new user to? prophet621 Linux - Newbie 2 03-02-2005 11:17 AM
Groups for an everyday user account linda Linux - Newbie 8 08-23-2004 07:14 PM

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

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

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