How to change Linux root password temporarily
If you are logged in as root and you don’t know the root password then you can follow the steps. You can easy to change your root password.
Step 1. Back-up your current shadow file.
[root@hostdens ~]# cp /etc/shadow /etc/shadowbkup
Step 2. Change the current root password
[root@hostdens ~]# passwd root
Changing password for user root.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
Step 3. Switch to a local user to test whether ‘your’ root password is working or not.
[root@hostdens ~]# su – localuser
[localuser@hostdens ~]$ su – root
Password:
[root@hostdens ~]#
Yes, you are now logged in as root with ‘your’ password.
Step 4. Restore the previous root password
[root@hostdens ~]# mv /etc/shadowbkup /etc/shadow
mv: overwrite `/etc/shadow’? y
[root@hostdens ~]#
.
.
.
.
This trick is meant for students and kindly do not misuse.
About Bizvibe Bizvibe is a B2B online platform that helps in connecting buyers and sellers…
File server investment is the smart investment anyone can make for their business. It has…
Because of the many advantages of the cloud, people are moving more and more towards…
Cloud Adoption Accelerates IT Modernization. More and more online businesses are increasing more and more…
Almost more than half of the total world’s population were using the internet by any…
Plesk is an IT service provider company which was founded in 2000 by Dimitri. The…
This website uses cookies.
Leave a Comment