Monday 30 January 2017

create multiple users in Unix with default password user should change password in first login .

1) create bash script

# vi userlist.sh

  #!/bin/sh

  for i in user1 user2 user3 user4  userN

  do

  useradd -s /bin/bash -m -d /home/$i $i


  echo "$i:newpassword" | chpasswd


  chage -d 0 $i


  done

2) save and exit file . and give executive permission .


#chmod 777 userlist.sh


#./userlist.sh


thats it enjoy !!!:)

No comments:

Post a Comment