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@hostripples ~]# cp /etc/shadow /etc/shadowbkup
Step 2. Change the current root password
[root@hostripples ~]# 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@hostripples ~]# su – localuser
[localuser@hostripples ~]$ su – root
Password:
[root@hostripples ~]#
Yes, you are now logged in as root with ‘your’ password.
Step 4. Restore the previous root password
[root@hostripples ~]# mv /etc/shadowbkup /etc/shadow
mv: overwrite `/etc/shadow’? y
[root@hostripples ~]#
.
.
.
.
This trick is meant for students and kindly do not misuse.
As the demand for virtual private servers (VPS) continues to grow, businesses and individuals are faced with a crucial decision:…
Web hosting is a large industry, as many other factors help any web hosting provider to form a company. The…
Welcome to the complete guide to WordPress security best practices in 2024. As technology evolves rapidly, implementing strong security measures…
Hey, wanted to learn about web hosting? Or do you want to start a new website and need hosting? Questions…
In today's digital world, the threat of DDoS attacks has become increasingly prevalent. These types of attacks have the power…