LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 02-15-2007, 09:03 AM   #1
bernadette
LQ Newbie
 
Registered: Feb 2007
Posts: 1

Rep: Reputation: 0
Forgotten username and password used during installation


Hi
I was helping a friend install Mandrake Linux Free 2006 and he entered a username and password for normal login and a root username and password. Unfortunately he could not remember exactly the spelling of the username he entered and we are left at the login screen with no means of entry. Is there anyway we can logon or do we need to do a reinstall?
 
Old 02-15-2007, 09:27 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Jessie 8.4
Posts: 5,873

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
You could re-install (write down the root password, user name and password so you don't forget them again).

You could also follow these instructions to wipe out the root password: http://www.unixguide.net/linux/faq/06.16.shtml. Then log in as root, set up a new root password (write it down). Then 'ls /home' to list the contents of /home, and get the spelling of the user name you set up.

Finally, set up a new password for the user (write it down).
 
Old 02-15-2007, 09:31 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
You have forgotten both the username/password AND the root password??
Did you try logging in as root?

Things to try:
1. At startup, when the GRUB screen is displayed, hit any key to stop the booting. You then have the option of editing the boot commands. Add the word "single" to the end of the line that starts with "kernel" and then boot. This should put you in a terminal mode without asking for a password.

2. Boot from the install disk and press ctrl-alt-F1 to get a terminal. In this mode, you will need to mount the Linux partition

Once you are running in a terminal, go to /etc and look for the "passwd" file. You can edit this with an editor---eg nano.
Command: nano /etc/passwd
Look for the root entry, and delete the "x"---so the entry looks something like this:
root::0:0::/root:/bin/bash
save the file and reboot. You will now be able to log in as root with no password. Now you can create a new password and a new user account.
 
Old 02-16-2007, 02:01 AM   #4
wpn146
Member
 
Registered: Jan 2005
Distribution: Solaris, Linux Fedora Core 6
Posts: 170

Rep: Reputation: 30
Some Unix flavors will demand a root password to reach single user mode. I know Solaris is one and I think some Linux distros are the same.

If your distro allows single user mode without a root password, you might want to edit your /boot/grub/grub.conf file (or /etc/lilo.conf if you are using lilo) after fixing the problem and create a new stanza there, essentially the same as the current one but with a new label (like "Linux single user") that already has the "single" or "1" appended. It will make it easier to run single user mode in the future.

If your distro will not let you in using single user mode without a password, then boot into rescue mode and mount your "/" partition at a convenient mount point (often the rescue mode will mount it at "/mnt/sysimage" for you.) Instead of editing /mnt/sysimage/etc/passwd (or whatever mount point you are using) I normally edit /mnt/sysimage/etc/shadow instead. The entry for "root" is normally the first line of the file. Remove everything between the first pair of ":"'s. For example, make:
Code:
root:abcdefghijkl0123456789:<whatever>
Look like:
Code:
root::<whatever>
If you can boot into single user mode without a password, then do the same editing except without the "/mnt/sysimage" part.

This will allow you to log in as "root" without a password. Once you are "root", you can put in a real root password with the "passwd" command.
 
Old 02-16-2007, 02:40 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
From the first posting it sounded to me like it is the regular username and password that were forgotten.

If you remember the root password, the username of the regular user is the same as the directory name in /home/.
It is also listed in /etc/passwd. You can change the password then with the root command: passwd username
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
if the root password is forgotten..... AnimaSola Linux - Software 1 05-31-2005 11:12 PM
forgotten my root password, help amanjsingh Linux - Newbie 16 03-31-2004 10:41 PM
username password forgotten red hat 9 scrollcap Linux - General 1 01-10-2004 08:24 PM
forgotten password ronss Linux - Distributions 4 04-01-2003 10:02 PM
forgotten username and password muz Linux - Newbie 2 02-10-2003 03:05 PM


All times are GMT -5. The time now is 07:33 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration