Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
We use a linux (centOS I believe) cluster for our research. My professor somehow forgot the new password he set for root, and now can't login as 'su'. What is the way (or best way) to reset the root password without damaging something. I don't know whether it's even setup for 'sudo'. What will the procedure with and without 'sudo'?
~Sourabh
The typical method is to boot into single-user mode. I'm not 100% sure that Redhat/Centos lets you do this without a password, but its worth a try.
Start up the computer. When you see the grub menu, then hit any key to stop the count, then:
With the desired entry higlighted, hit "e" for edit.
Select the kernel line, and "e" again
Add the word "single" (no quotes) at the end
hit return (enter), then "b" to boot
The machine should come up in a terminal mode, root account, with no password needed.
Assuming all this works, enter "passwd root", the new password, and then "init 5" to go back to normal. (Or maybe "init 3" with a server?)
If this does not work, the only options I know is to boot the system from live CD, mount the partition containing /etc, and edit the "passwd" file to remove the first "x" in the root entry. This then allows root to login with no password.
Distribution: Gentoo, RHEL (Fedora, CentOS, OEL), Ubuntu, FreeBSD, Solaris 10
Posts: 170
Rep:
Hi
You have to reboot your box:
Select the kernel
Press the e key to edit the entry
Select second line (the line starting with the word kernel)
Press the e key to edit kernel entry so that you can append single user mode
Append the word Single to the end of the (kernel) line
Press ENTER key
Now press the b key to boot the Linux kernel into single user mode
"init" is the first program run by the kernel at boot time. You can also use it to change runlevels. /etc/inittab typically tells you what happens in each runlevel.
Suppose I kill X-Windows by entering "init 3". Then I can edit config files, maybe install a new video driver, and then get back to the GUI by entering "init 5"
BUT--the runlevels are not the same on all systems....
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.