Change password with usermod

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm trying to set a password directly from a script, using usermod, but i get an error, i shouldn't get:

#!Bin/bash
groupadd postgres
useradd -g postgres postgres
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"

But the odd thing is that it exists with that uid.

Any ideas ?

Warm Regards,
Mário Gamito
-
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

[Index of Archives]     [Linux Newbie]     [Audio]     [Hams]     [Kernel Newbies]     [Util Linux NG]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Device Drivers]     [Samba]     [Video 4 Linux]     [Git]     [Fedora Users]

  Powered by Linux