LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-08-2015, 02:44 AM   #1
vikilinux
LQ Newbie
 
Registered: Mar 2014
Posts: 21

Rep: Reputation: Disabled
How to delete multiple users at a time


Dear Buddies

I heared that userdel -r "username" will delete user in linux.How to delete multiple users in a single command?If it is possible pls let me know.
 
Old 01-08-2015, 02:57 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 20,252

Rep: Reputation: 6837Reputation: 6837Reputation: 6837Reputation: 6837Reputation: 6837Reputation: 6837Reputation: 6837Reputation: 6837Reputation: 6837Reputation: 6837Reputation: 6837
make a for loop
 
Old 01-08-2015, 03:04 AM   #3
vikilinux
LQ Newbie
 
Registered: Mar 2014
Posts: 21

Original Poster
Rep: Reputation: Disabled
Thanks friend

Can you explain by Using Syntax.
 
Old 01-08-2015, 04:05 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 20,252

Rep: Reputation: 6837Reputation: 6837Reputation: 6837Reputation: 6837Reputation: 6837Reputation: 6837Reputation: 6837Reputation: 6837Reputation: 6837Reputation: 6837Reputation: 6837
that depends on how the list of users are stored?
 
Old 01-08-2015, 09:16 AM   #5
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Originally Posted by vikilinux View Post
Can you explain by Using Syntax.
Code:
for u in user1 user2 user3 user4; do echo "$u"; userdel -r "$u"; done
 
Old 01-08-2015, 09:58 AM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,249
Blog Entries: 4

Rep: Reputation: 3777Reputation: 3777Reputation: 3777Reputation: 3777Reputation: 3777Reputation: 3777Reputation: 3777Reputation: 3777Reputation: 3777Reputation: 3777Reputation: 3777
Careful ... you can shoot yourself in the foot real easy.

If you have a lot of users to manage, then I suggest that you switch to LDAP-based authentication, where you can use a slew of existing utilities to easily manage large numbers of users, groups, and their associated attributes. This is pretty much just a management problem, but a very common one that applies in the general sense to all aspects of access-control. Your company probably already has a security team that's using similar tools, e.g. to manage the badge-readers at the doors. Leverage what they're already doing. LDAP (nee Microsoft OpenDirectory™), or Kerberos, is already more-than-sufficient to do this.

Last edited by sundialsvcs; 01-08-2015 at 10:00 AM.
 
  


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
how to delete multiple users from Samba Gustav780924 Linux - General 1 01-26-2011 12:49 PM
sending a file thru ftp to multiple users at a time.... visitnag Linux - Desktop 7 02-05-2009 10:57 AM
Multiple Autologins; Multiple Users; Multiple Sessions mrclisdue Linux - Desktop 1 09-26-2007 05:50 AM
kde 3.4 and Multiple Users... Using sound at the same time nicolaslara Linux - Software 4 10-03-2005 01:55 AM
need multiple users to have read/write access to a Quickbooks file at the same time. rbelknap Linux - Security 2 10-14-2003 10:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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