I wants to create 3 users and set password for the users in 400 servers. I can run this script without error. If wants to set the password in the same command it is not working. Like that i have to create 3 users
#!/usr/bin/ksh
for server in `cat /tmp/servers`
do
echo "servername = $server"
ssh $server 'sudo /usr/sbin/useradd -d /home/user -m -c "DBA Team at `date +%d-%m-%Y`" -s /usr/bin/ksh user' exit
done
this command showing the error if i add the passwd cmd in this script
ssh $server 'sudo /usr/sbin/useradd -d /home/user -m -c "DBA Team at `date +%d-%m-%Y`" -s /usr/bin/ksh user; sudo passwd user' exit