useradd with * in passwd field
Chris Tyler
chris at tylers.info
Mon Apr 6 14:16:34 UTC 2009
On Mon, 2009-04-06 at 19:37 +0530, Sudarshan Soma wrote:
> Hi All,
> I need to add a user who will have entry in the /etc/passwd file as
> below, where the passwd field is marked as *
>
> myuser:*:12:23:guest:/:/bin/bash
>
> I need to do this by using command useradd, but i am not able to find
> easier way to do this by commands other than manually editing passwd
> file.
>
>
> The intention is to create a user with whcih login can never happen
> Please suggest
Hi Pavan,
First, you should in almost all cases have shadow password support
enabled, so the actual passwords will be in /etc/shadow not /etc/passwd.
Second, useradd will by default create an account which cannot be
accessed until a password is added (typically with the passwd command).
If you need to lock an account that has a password so that it cannot be
used for login, you can use "passwd -l username"; note that this
prepends an exclamation mark to the password field (does the same thing
as your star). The opposite command is "passwd -u username", which
unlocks the account.
-Chris
More information about the fedora-list
mailing list