Friday, May 11, 2012

Command-line syntax to reset the password

Let’s say we have to reset the Root password of a Linux machine to “XYZabc123”.  We can use the below command set to do it. This can be executed on remote machines if we have a centralized administration server.

# echo ‘XYZabc123’ > /opt/pass; passwd --stdin root < /opt/pass; rm -f  /opt/pass

No comments:

Post a Comment

Popular Posts

About Me

My photo
I have started this blog to share my work experience and spread some smart solutions on Linux to Internet community. I'm hoping more people will get benefited from this blog. Brief about me: I have 14+ years experience working as System Admin and currently work with VMware.