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
The intent of this blog is to share my work experience and spread some smart solutions on Linux to System Administrators. I'm hoping the solutions shared in this Blog would be helpful and come as a handy for Viewers. Brief about me: I have 18+ years work experience in System and Cloud Administration domain, primarily works on VMware Cloud Products (vSphere, vCloud Director, vRealize Automation, NSX Adv. Load Balancer, vROps).