Re: useradd with * in passwd field

2009-04-06 Thread Mikkel L. Ellertson
Sudarshan Soma wrote:
> Thanks Chris.
> I got the command ,
> usermod -p "*" user  &> /dev/null
> 
> Actually i want to make user with no access at any time.
> 
> Best Regards,
> pavan
> 
Depending on exactly what you are after, you man want to look at
setting the shell to /sbin/nologin.
(-s /sbin/nologin)

-- 

A:  Because it messes up the order in which people normally read text.
Q:  Why is top-posting a bad thing?




signature.asc
Description: OpenPGP digital signature
-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

Re: useradd with * in passwd field

2009-04-06 Thread Aldo Foot
On Mon, Apr 6, 2009 at 7:50 AM, Sudarshan Soma  wrote:
> Thanks Chris.
> I got the command ,
> usermod -p "*" user  &> /dev/null
>
> Actually i want to make user with no access at any time.
>
> Best Regards,
> pavan

You mean not let it login ever?
Then change the shell entry as shown.
   myuser:*:12:23:guest:/:/sbin/nologin

You cannot even login from the root account, you get a
message that says: "This account is currently not available."
It works well for service accounts that do not require login or
user interaction.

Also, please when replying, post at the bottom of the message.
~af

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: useradd with * in passwd field

2009-04-06 Thread Chris Tyler
On Mon, 2009-04-06 at 20:20 +0530, Sudarshan Soma wrote:
> On Mon, Apr 6, 2009 at 7:46 PM, Chris Tyler  wrote:
> > 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.
> >
> Thanks Chris.
> I got the command ,
> usermod -p "*" user  &> /dev/null
> 
> Actually i want to make user with no access at any time.
> 
> Best Regards,
> pavan

Pavan,

If you're using usermod, you'll want the -L option.

(Also: on this list (and other Fedora lists), please reply at the bottom
of messages instead of the top -- it preserves the flow of discussion).

-Chris

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: useradd with * in passwd field

2009-04-06 Thread Stephen Berg (Contractor)

Sudarshan Soma wrote:

Thanks Chris.
I got the command ,
usermod -p "*" user  &> /dev/null

Actually i want to make user with no access at any time.

Best Regards,
pavan
  
You should probably use "passwd -l " then.  Let the passwd 
command lock the account properly.


--
Stephen Berg
Systems Administrator
NRL Code: 7321
Office: 228-688-5738
stephen.berg@nrlssc.navy.mil 


--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: useradd with * in passwd field

2009-04-06 Thread Sudarshan Soma
Thanks Chris.
I got the command ,
usermod -p "*" user  &> /dev/null

Actually i want to make user with no access at any time.

Best Regards,
pavan

On Mon, Apr 6, 2009 at 7:46 PM, Chris Tyler  wrote:
> 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
>
> --
> fedora-list mailing list
> fedora-list@redhat.com
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
> Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
>

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: useradd with * in passwd field

2009-04-06 Thread Chris Tyler
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

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines