LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 05-02-2002, 02:42 PM   #1
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
Help! I closed myself out of Linux!


Please help me, suddenly I closed myself out of my Linux!
When logged in as root, I typed 'passwd' without any user names.
Then I got the 'passwd:' prompt, and here I realized that I did a mistake.
Not knowing what is the best way to leave the 'passwd:' prompt, I decided to type in two different passwords, which, in my hopes, should have resulted in an error message and leaving the 'passwd:' prompt.
So, the first time I pushed some random keys and ENTER. Linux told me that the password is too short, and, unfortunately, gave me back the "passwd:' prompt. Then I typed in some other random keys and ENTER. For my astonishment, Linux told me: 'password changed'. I do not know how could I change the password this way, since I only typed in two different random key sequences, the first of which was even too short to be taken into account, as Linux itself told me (Until now, I thought that I have to enter and re-enter exactly the same key sequences of the correct length to change an existing password - which was not the case this time). Naturally, I wanted to change the password back while I was logged in as root, but Linux got into an unusual operating mode: from that time on all messages and prompts were printed on the same line. Confused by this behaviour, I did an other mistake: pressed CTRL+ALT+DEL to restart the system. Since then I cannot login into my Linux box.
Could you please tell me how could I clear the unintentionally changed root password, or to what extent should I re-install Linux to get back the command over my Linux box? Is it possible to keep the data and programs installed during such a re-installation of Linux? (I know I could do a complete re-install, but then all data and programs would be destroyed).
Your urgent help is a must, as I need Linux, furthermore, I can only browse the NET under Windows and IE in the meantime, which I hate. (My mouse does not feel well in Window$, either: it seems to limit its functionality to one single window on the screen and other windows can only be controlled by the keyboard - a thing that never happened in Linux and often happens in Windows nowadays.)

Last edited by J_Szucs; 05-02-2002 at 02:45 PM.
 
Old 05-02-2002, 02:48 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
boot into single user mode.. change password for root there with the passwd root command.....
 
Old 05-02-2002, 02:51 PM   #3
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
Wow!

But how to boot into single user mode?
 
Old 05-02-2002, 02:56 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
if your using lilo... at lilo prompt type: Linux Single or init 1
 
Old 05-02-2002, 03:30 PM   #5
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
No success

I use lilo, but it did not help:
When I type 'Linux Single', Linux gives me 'szj login:' prompt, and I can do nothing since I do not know the root password.
When I type 'init 1' Linux prints an error: 'no such image', then asks for the root password, which I do not know any longer.
I always started Linux as root from the beginning as I read somewhere that I may have difficulties in establishing dial-up connection on a normal user account (later I came to know that it is not true, but I was too lazy to change it and it was too comfortable to be root). I do not even know if I ever created any other user account and what password it may have. Maybe I always used a single user account and thus closed the last door?
 
Old 05-02-2002, 04:10 PM   #6
AutoBot
Member
 
Registered: Mar 2002
Location: I can see you from here.
Distribution: Gentoo 1.3b
Posts: 184

Rep: Reputation: 34
Are you sure it actually changed the password, you may have tried this or not but try simply hitting enter when it asks for the password. Probably will not work but was just a thought
 
Old 05-02-2002, 10:21 PM   #7
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
Yes, I tried just hitting ENTER but it did not work.
 
Old 05-02-2002, 10:49 PM   #8
JimKyle
Member
 
Registered: Dec 2001
Location: Oklahoma City, OK, USA
Distribution: Xubuntu 16.04 LTS
Posts: 214
Blog Entries: 1

Rep: Reputation: 39
If you have an emergency boot floppy, you can boot from it instead of through Lilo. You should be able to get into Single-user mode with it.

If that doesn't work, use a Google search to find the home page for "tomsrtbt" and download the Windows package of that system. It's a single-floppy Linux system complete with all utilities, and you can create it from within Windows. Then use it to boot, mount your hard drive as "/mnt/fix" or some similar name that's not in the file system, and from there use vi to edit /mnt/fix/etc/passwd. Delete the string of garbage-looking characters between the first two ":" characters on the line for "root" and save the file. Then reboot normally without the floppy, and you should be able to log in as root with no password at all. From there you can restore your original password.

Hope this helps. The procedure is spelled out in several of the introductory books, except for the use of "tomsrtbt" to get access to the file system without a normal login...
 
Old 05-03-2002, 08:34 AM   #9
Calum
Member
 
Registered: Mar 2002
Location: London
Distribution: Red Hat 9
Posts: 302

Rep: Reputation: 30
what i have to say will not help you at all, but i just wanted to say that all the guides et c i have read about user admin state right off the bat that the first thing you should do is create a non root account, and then never use root at all. When you need to do something as root it is incredibly easy to su to root, remembering to exit out again afterwards.
Sorry, again, it's not meant to be condescending, just an object lesson to any other readers who may be heading for the same problem...
 
Old 05-03-2002, 11:24 AM   #10
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
Thank you Jim!

Your tip worked, I am back in my Linux again!

As for Calum's note: you are absolutely right, but as I mentioned here, I am too lazy to change a practice that works and is comfortable. (Strange, but now, when this acciddent happened I was about to create some sample accounts to establish and test a multi-user backup system.) Just to reassure you: I would not recommend anyone else the practice I follow, moreover, when I did installations for my colleagues (whom I try to convince to use Linux at home) I always created the correct user's accounts and recommended them to use that instead of root.
 
Old 05-03-2002, 12:01 PM   #11
JimKyle
Member
 
Registered: Dec 2001
Location: Oklahoma City, OK, USA
Distribution: Xubuntu 16.04 LTS
Posts: 214
Blog Entries: 1

Rep: Reputation: 39
Glad to know it did! I've not had to use the trick myself (yet) so it was mostly theoretical...
 
Old 08-05-2002, 09:39 PM   #12
TomG
LQ Newbie
 
Registered: Jul 2002
Distribution: SuSE 8 Pro
Posts: 13

Rep: Reputation: 0
I know this is an old thread, but there is something that is bugging me about it, and I'm wondering...

Would the procedure mentioned by JimKyle work to get access to the root account by someone other than root? It seems to me that a way to stop that easily would be to not allow it to boot from a floppy, but what if you use a floppy as a boot disk, for example if you have Windblows on another partition? And, you would block yourself out from using a rescue disk if you disabled booting from a floppy.

Any comments? Am I just nuts? Is there some simple way to stop access that way?

 
Old 08-05-2002, 10:35 PM   #13
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
you can setup dual boot w/o floppy involved, but note if you are using a bootloader (which you should to dualboot) then there is still a possibility to boot into single usermode, unless you defined lilo or grub to boot directly to linux without a delay (this of course defeats the idea of dualboot), now there is still a solution - password protect a single usermode it is called creating trusted user profile - I found that Bastille http://www.bastille-linux.org can do it, but I was not successfull to figure out myself how to password protect single usermode w/o any third party soft, meaning I am still in search on how to create trusted user system profile.

Last edited by neo77777; 08-05-2002 at 10:37 PM.
 
Old 08-10-2002, 01:02 AM   #14
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
The safest way is to password protect the boot loader like lilo for example, then making it only readable by root so no one can view the password that is setup in the file as its usually not encrypted.
Then you would want to password protect the BIOS and make it so you can't boot to a floppy or cdrom so they can't get around the boot loader password prompt to gain root access.
But of course they can always reset the BIOS by pulling the battery on board to reset any passwords setup, so if your really paranoid, then make sure the case has some sort of locking device.
And last, don't forget any of the passwords you setup and use, then you won't have any problems...
 
Old 08-15-2002, 03:09 PM   #15
Neur0tek
LQ Newbie
 
Registered: Apr 2002
Location: USA
Distribution: SuSE 8.0
Posts: 23

Rep: Reputation: 15
GNOME 2.0 got eeeeevil

I don't know how it happened at all but once I put GNOME 2.0 on all of my logins went to hell. I just wanted to say that going through the whole forums and piecing together answers from posts on this forum really helped allot. Thank you to all of the answer givers.
By the way....MAKE A BOOT DISK IF YOU ARE INSTALLING A NEW SYSTEM (RH 7.3) BECAUSE IT WILL SAVE YOUR BACKSIDE!

linux single
passwd

was the fix.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
closed source Linux fakie_flip General 20 09-15-2005 01:28 PM
Questions that can be Closed StephenCM LQ Suggestions & Feedback 10 05-09-2005 06:05 PM
Skype for Linux - closed beta test announced 05/16/04 furfurdemon666 Linux - Software 1 07-17-2004 01:22 AM
IBM.com/open is closed to Linux users? macewan Linux - Software 3 01-12-2004 05:14 AM
port closed hotrodowner Linux - Networking 2 12-02-2002 05:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration