1832516 Members
5252 Online
110043 Solutions
New Discussion

/etc/shadow

 
Ragni Singh
Super Advisor

/etc/shadow

Hello, currently in my /etc/shadow, in the 2nd password field, I have a password :......:. I would like to replace that filed with just a *, ie, :*:.

How would I do that.

I need to put a star so it will force the user to use kebros.

Thanks and points will be assigned.
2 REPLIES 2
Steven E. Protter
Exalted Contributor

Re: /etc/shadow

Shalom Sanjit,

very carefully:

send s/....../*/g /etc/passwd > /tmp/passwd.new

Edit it with vi, make sure its okay.

Take out root and admin users you don't want affected.

Shut down authentication.

You may need to put quotes around the asterisck.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ivan Ferreira
Honored Contributor

Re: /etc/shadow

awk -F ":" -v OFS=":" '$2="*" { print $0 }' /etc/shadow > /etc/shadow.locked

Extrange question, and dangerous, you will be disabling root account.

User usermod -L username to lock an user account.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?