LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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
 
LinkBack Search this Thread
Old 01-29-2010, 07:09 AM   #1
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Various types of linux
Posts: 1,018

Rep: Reputation: 63
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
Location: Dhaka,Bangladesh
Distribution: Various types of linux
Posts: 1,018

Original Poster
Rep: Reputation: 63
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: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
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: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
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: Slackware 14.0
Posts: 8,464

Rep: Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877
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: 226Reputation: 226Reputation: 226
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
Location: Dhaka,Bangladesh
Distribution: Various types of linux
Posts: 1,018

Original Poster
Rep: Reputation: 63
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: 226Reputation: 226Reputation: 226
Install

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

Rep: Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266
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
Location: Dhaka,Bangladesh
Distribution: Various types of linux
Posts: 1,018

Original Poster
Rep: Reputation: 63
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,221

Rep: Reputation: 285Reputation: 285Reputation: 285
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
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,314

Rep: Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816
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: 1,904

Rep: Reputation: Disabled
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 13.37
Posts: 436

Rep: Reputation: 56
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


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
Trackbacks are Off
Pingbacks are On
Refbacks are 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


All times are GMT -5. The time now is 05:01 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration