From: Krzysztof Dubowik <kite@interia.pl>
To: linux-admin@vger.kernel.org
Subject: Re: Change password with usermod
Date: Sat, 10 Mar 2007 12:55:01 +0100 [thread overview]
Message-ID: <esu6am$4rg$1@sea.gmane.org> (raw)
In-Reply-To: 45F28B94.5020800@gmail.com
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2007-03-10 11:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-10 10:42 Change password with usermod Mário Gamito
2007-03-10 10:56 ` Mário Gamito
2007-03-10 11:55 ` Krzysztof Dubowik [this message]
2007-03-10 12:05 ` Mário Gamito
2007-03-10 21:42 ` Ian Ward Comfort
-- strict thread matches above, loose matches on Subject: below --
2007-03-10 9:53 Mário Gamito
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='esu6am$4rg$1@sea.gmane.org' \
--to=kite@interia.pl \
--cc=linux-admin@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).