LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 11-23-2004, 12:23 AM   #1
mlu
Member
 
Registered: Nov 2004
Location: colombo
Distribution: Fedora
Posts: 74

Rep: Reputation: 15
Question adding linux users help pls


how can i add multiple users to the same group at the same time???
 
Old 11-23-2004, 01:54 AM   #2
nixcraft
Member
 
Registered: Nov 2004
Location: BIOS
Distribution: RHEL3.0, FreeBSD 5.x, Debian 3.x, Soaris x86 v10
Posts: 379

Rep: Reputation: 30
Re: adding linux users help pls

Quote:
Originally posted by mlu
how can i add multiple users to the same group at the same time???
useradd -g SAMEGROUP user

Example to add user raj to FTP group

Code:
useradd -g ftp raj
passwd raj
Now to add multiple users? you can write simple script,

1) Create file with all users in /root/users.name
cat > /root/users.name
foo
bar
raju
kaju
you
me

2) Save file

3) Create script as follows
cat > /root/musers.bash
#!/bin/bash
AUSRS=`cat /root/users.name`
GRP=ftp
for i in $AUSRS
do
useradd -g $GRP $i
done

4) Save script

5) Run script
chmod +x musers.bash
./musers.bash
 
Old 11-23-2004, 02:46 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,042

Rep: Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956
Code:
man newusers
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
adding users rharris72 Programming 5 12-02-2005 05:51 PM
Adding users muppski Programming 5 04-08-2005 02:41 AM
Calling For Vaio Linux Users, pls provide some help danieln Linux - Laptop and Netbook 4 09-28-2004 09:38 AM
Basic install for child users - advice pls davidcthursby Linux - General 6 07-02-2004 06:02 PM
pls pls pls help me ! i'm tired with httpd config on fedora apache 2.0.48 AngelOfTheDamn Fedora 0 01-24-2004 05:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:17 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