Linux - Newbie This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
![Reply](https://www.linuxquestions.org/questions/images/buttons/reply.gif) |
|
07-11-2003, 02:58 PM
|
#1
|
LQ Newbie
Registered: Jul 2003
Posts: 5
Rep:
|
Lost root Password
Hello All,
We have lost the root password to our RedHat Linux 8.0 server. We found out that we could type;
LiLo: Linux Single or Linux 1
at the Lilo prompt. But since the machine boots up to a graphical interface we are trying to figure out how to break out of the graphical interface to get to the Lilo prompt.
Any help would be appreciated.
John S.
johns@rrcol.com
|
|
|
07-11-2003, 03:03 PM
|
#2
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
In singe user mode you shouldn't get a gui.
Edit your kernel arguments and add "single" to the end.
|
|
|
07-11-2003, 03:32 PM
|
#3
|
LQ Newbie
Registered: Jul 2003
Posts: 5
Original Poster
Rep:
|
I kinda despise myself for being such a newbie. Perhaps I need to explain a bit a more.
The machine starts and goes though enabling everything and ends up in a GUI login screen.
but way before that, it comes to a screen that has options of what linux version(?) to load. if I hit "e" to edit that line, it gives me 3 lines like:
root (disk0, part1)
boot =/vmlinuz/something or the other
something = /bin/or_something_or-the-other
(Sorry, I am not near that machine at this time, so I could not specify the exact contents of the 3 lines)
I can hit "o" or "O" to include commands in this script(?)
should I include "single" as the last line? or would it go somewere else.
I appreciate your help.
-John ![Confused](https://www.linuxquestions.org/questions/images/smilies/confused.gif)
Last edited by us06154; 07-11-2003 at 03:36 PM.
|
|
|
07-11-2003, 03:50 PM
|
#4
|
Senior Member
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403
Rep:
|
If I remember correctly, you must press [Ctrl]-[x] to exit the LILO graphical screen.
Then at the prompt, type
linux single
OR
linux emergency
|
|
|
07-12-2003, 05:38 AM
|
#5
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
One of the 3 lines should contain the word kernel. At the end of that line type a space then the word "single" there should be an option to save that line then boot with these temporary settings.
|
|
|
07-12-2003, 05:44 AM
|
#6
|
LQ Newbie
Registered: Jul 2003
Posts: 12
Rep:
|
if your box has a disk drive, just boot from your rescue disk, mount the root partition of your harddisk and edit $mountpoint/etc/shadow to clean up the root password.
eg you have a line:
root:$1$c5jQCl$dYjklö34kg5jjeHkE/:12143:0:99999:7:::
in there, just change it to:
root::12143:0:99999:7:::
then reboot and just type enter when asked for root pwd.
|
|
|
07-12-2003, 06:25 AM
|
#7
|
LQ Newbie
Registered: Jul 2003
Posts: 5
Original Poster
Rep:
|
Hi Isme,
I searched the stack of junk by the Server, and did not find anything like a rescue diskette or an Emergency diskette. I will have to revisit this issue on Monday, and try David Ross's method of typing Single at the end of the line has the "Kernel" entry.
If I have the cd ISO images, can I make a rescue Diskette?
Thanks for your assistance.
|
|
|
07-12-2003, 06:49 AM
|
#8
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
That IS the cd rescue ![Wink](https://www.linuxquestions.org/questions/images/smilies/wink.gif) You plop in the the CD and then at the opening prompt type 'rescue' without the ' ' .
It's suggested to try single first (usually ? ) then move onto more drastic ways such as editing your password files. However, since you are going to be changing root's password anyway, I guess it's whatever is easiest for you. You should be aware of how easy this is for you in the end and do your best to:
1. Ensure you will always remember root's password ![Wink](https://www.linuxquestions.org/questions/images/smilies/wink.gif) ;
2. Do everything you can to remove the ease that you encounter to gain root access. If you can do it, why can't anyone else just as easily?
Sorry if I sound like a freak, I've been reading literally hundreds of pages of security docs for the last couple of days and am becoming more and more paranoid someone might see my email to me about my car's exhaust
Cool
|
|
|
07-14-2003, 04:44 PM
|
#9
|
LQ Newbie
Registered: Jul 2003
Posts: 5
Original Poster
Rep:
|
Finally Got In
Thanks David, and the rest of the gang,
After following David's advice, and appending single to the end of the entry that had kernel, managed to change the password.
You guys are the best. Thanks for helping out to take care of the problem.
|
|
|
07-14-2003, 05:25 PM
|
#10
|
Senior Member
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185
Rep:
|
but judging by what you said masterC how can you prevent and intruder from doing this to your machine? like if it is just as easy as that to "reset" the root password, and like you said it would just be as easy for someone else to do it...so what has to be done to prevent this? like i know i will never forget my password, so is there anyway to make it non reversable?
|
|
|
07-14-2003, 06:22 PM
|
#11
|
Member
Registered: Mar 2003
Location: Winnipeg
Distribution: Suse 9.3 Pro
Posts: 404
Rep:
|
Most of the suggestions above take in having physical access to the PC in question and as long as you have a password for LILO or GRUB this could deter some of the suggestions couldn't it?
|
|
|
07-14-2003, 06:46 PM
|
#12
|
Senior Member
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185
Rep:
|
yes i realize it is more so directed towards physical access...but no matter what kind of access it is let it be sittin in front of the target machine are sitting behind your machine in la la land, trying to access someones machine, i am just curious about a way to prevent the "reseting" of the root password
|
|
|
07-14-2003, 09:15 PM
|
#13
|
LQ Newbie
Registered: Jul 2003
Posts: 5
Original Poster
Rep:
|
I would probably never forget my password as well. Luckily, the previous admin was a College intern, working part time. I am glad this "backdoor" was available. I wanted to access some info off this machine and wipe it out, and install Windows 2003 on It... Just kidding!!! I have to install Redhat 9 on it. Physical Security was not an issue, as access to the machine area is by card access only.
|
|
|
07-14-2003, 09:32 PM
|
#14
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
Quote:
Originally posted by DrOzz
yes i realize it is more so directed towards physical access...but no matter what kind of access it is let it be sittin in front of the target machine are sitting behind your machine in la la land, trying to access someones machine, i am just curious about a way to prevent the "reseting" of the root password
|
There are ways to keep anyone from overwritting current files or even appending to them, one way:
chattr +i
On the file. Root cannot even append to the file if this is applied. You will have to:
chattr -i
To remove that restriction to actually change the files. It's a quick and easy thing to do to:
/etc/passwd
/etc/group
/etc/shadow
Just remember you did it should you choose to. This is obviously un-doable should one gain root access, but this will keep them from gaining root access an easier way.
HTH
Cool
|
|
|
07-15-2003, 02:00 PM
|
#15
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
Just so you don't get over confident you should know that it is possible to boot from a cd/floppy and reset the password. You may want to set the boot order to boot from the HDD first.
NOTE: Even thi isn't full proof as you can transplant the HDD to another machine.
|
|
|
All times are GMT -5. The time now is 04:02 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|