about advertise contact
Search: Home Vulnerabilities Exploits News Articles RSS Feeds Archive Talk


2008-04-04 Create Users And Change Passwords With A Bash Script

These two scripts are very important for the system admin who regularly
works with mail servers and somehow forgets to backup his system
username and password! Let’s say somehow we lost the usernames and passwords of the mail server. In this case the admin has
to manually create all the users and then change the passwords for
all the users. Tedious job. Let’s make our life easier.



First create a file which contains all the user name. Something like
this:



nurealam

nayeem
mrahman
farid
rubi
sankar

Save the file as userlist.txt. Now
create the following bash file:


#!/bin/sh

for i in `more userlist.txt `
do
echo $i
adduser $i
done

Save the file and exit.


chmod 755 userlist.txt


Now run the file:


./userlist.txt


This will add all the users to the system. Now we have to change the
passwords. Let's say we want username123 as password. So for user nayeem
the password will be nayeem123, rubi123 for user rubi and so on.


Create another bash file as follows:


#!/bin/sh

for i in `more userlist.txt `
do
echo $i
echo $i"123" | passwd –-stdin "$i"
echo; echo "User $username’s password changed!"
done

Run the file. All the passwords are changed.


Advertising

Copyright 2007, SecurityDot
Sun, 08 Nov 2009 10:35:22 +0000

Friends : milw0rm.com , secunia.com , securityfocus.com
GOOGLE
NEWS EXPLOITS VULNS
exploits , 0day exploits , newest exploits , vulnerabilities , newest vulnerabilities , 0day vulnerabilities , newest articles , linux articles , articles
www.zg9439 iindian se blackporn WWW.Tamilm www.zg9439 domit Exploit-MS vnc bypass PHP guestb sex89com www.sexyla www.zg9439 Googlesexc play vidoe www.sexyla Hrthik blue films www.zg9439 www xnxx s www.ff6.cn bbs.tmzj.n 89 sex vid search/exp Snitz ascii make Mahnaz afs www.90645. CMS is Fre www xnxx s www xnxx s spam yk158.cn Sexsybreas Babysex.co juice puss phpbb++por Snehasex mambo Remo http:/www. al4a www.cnzmfs mambo Remo zroxy Www.sex vi mambo Remo sexyjapan. www.hss365 Www sex.Co phpbb inje mambo Remo