From mboxrd@z Thu Jan 1 00:00:00 1970 From: Krzysztof Dubowik Subject: Re: Change password with usermod Date: Sat, 10 Mar 2007 12:55:01 +0100 Message-ID: References: <45F28B94.5020800@gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Sender: linux-admin-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="iso-8859-1" To: linux-admin@vger.kernel.org Hi, M=C3=A1rio Gamito wrote: > PASS=3D`mkpasswd secret` > ID=3D`cat /etc/passwd | grep postgres | cut -f3 -d':'` > usermod -p $PASS -u $ID >=20 > 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html