Hi, Mário Gamito wrote: > PASS=`mkpasswd secret` > ID=`cat /etc/passwd | grep postgres | cut -f3 -d':'` > usermod -p $PASS -u $ID > > This gives me: > "usermod: user 502 does not exist" usermod needs a login name rather than the userid and you don't need -u option: # usermod -p $PASS postgres However, I usually user chpasswd to change the password from a script, so your script becomes: # echo postgres:secret | chpasswd Hope this helps, Krzysztof - To unsubscribe from this list: send the line "unsubscribe linux-admin" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html