LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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-02-2004, 03:02 AM   #1
rooney18
LQ Newbie
 
Registered: Sep 2004
Location: ireland
Posts: 9

Rep: Reputation: 0
scripts


hi their, could someone please tell me where i could find a script for creating many users.
and if possabile a script for monitoring machines/ ports and logging.
please help desperate!!
thanks...
 
Old 11-02-2004, 03:46 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
Code:
netstat -a
will show you the currnet status of all ports.
Code:
watch -n s netstat -a
will do the same, but update once every s seconds

You can create a user using the adduser command; try
Code:
man adduser
If you want to create lots of users at once, then you still have to get their usernames from somewhere. The following Perl script:
Code:
#!/usr/bin/perl
foreach (<>) {
  system("adduser $_");
}
will create users, taking the usernames from standard input.
 
Old 11-02-2004, 05:24 AM   #3
rooney18
LQ Newbie
 
Registered: Sep 2004
Location: ireland
Posts: 9

Original Poster
Rep: Reputation: 0
thanks a million. but iam not sure where to enter the names and how do i divide each name
eg robert,john,mick, or is it "robert"john"mick"
#!/usr/bin/perl
foreach (<> ) {
system("adduser $_"); do the names go here on this line after $
}

thanks for the help!!
 
Old 11-02-2004, 06:43 AM   #4
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
Run the script as it is. You can then type in the usernames, one per line. Press Ctrl+D (end of file) when done.

Alternativly, create a text file (say users.txt) containing each name, one per line, and pipe it into standard input:
Code:
./users.pl < users.txt
 
Old 11-02-2004, 08:12 AM   #5
rooney18
LQ Newbie
 
Registered: Sep 2004
Location: ireland
Posts: 9

Original Poster
Rep: Reputation: 0
Thumbs up

thanks a million rjlee thats a great help. perfect!!!
 
  


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
VPN: Debian Scripts -> Mandriva 2006 Scripts Undefined Mandriva 0 11-30-2005 12:10 PM
Need help running scripts from scripts sdouble Linux - Newbie 3 05-31-2004 12:56 PM
What scripts would you like to see? kittani Linux - Software 1 05-20-2004 03:26 AM
Scripts? zombie killa Linux - Software 5 05-29-2003 05:19 PM
scripts mdjames0 Linux - Newbie 4 08-02-2002 09:10 PM

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

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