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 10-15-2013, 08:25 AM   #1
unlimit
LQ Newbie
 
Registered: Oct 2013
Posts: 7

Rep: Reputation: Disabled
How to rescue/change password in RHEL6 under VirtualBox?


Hello,
I am new here from Asia.
Its good to be here and like to ask question on RHEL 6

I installed RHEL 6 on Virtual box and second time when I started the Virtual box I forgot whats the username and password for RHEL 6.

I searched on this form for resetting password and username like---

going to single mode and typing passwd for changing password..

Its not helping, it shows me blank after I type "passwd" or "passwd root" or "passwd username"

I am damn confused about this..

Any suggestions or method to get back the password and username back..

Thank you!
 
Old 10-15-2013, 08:35 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Can't you log in as root (after a normal boot)?

If not: After you start in single usermode you are root and can do the following:
- Use cat /etc/passwd to show all users, which should also show the one you forgot.
- Use passwd username to set a new password.
- reboot into normal mode (init 6)
 
Old 10-17-2013, 05:18 AM   #3
unlimit
LQ Newbie
 
Registered: Oct 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hello,
thanks for the reply but its not working.
It says "no such directory"
What I did -
Edit - kernel - then typed - single or 1 then - b - then - now i am in Single user mode - #- I typed your options - but nothing works- cat /etc/passwd (it says no such directory) - for passwd username - then enter - it shows blank space- then I have to boot it forcefully.

Thanks!


Quote:
Originally Posted by druuna View Post
Can't you log in as root (after a normal boot)?

If not: After you start in single usermode you are root and can do the following:
- Use cat /etc/passwd to show all users, which should also show the one you forgot.
- Use passwd username to set a new password.
- reboot into normal mode (init 6)
 
Old 10-17-2013, 06:53 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
You didn't answer my question: Can't you log in as root (after a normal boot)?
There's no need to go into single usermode when you can log in as root.

Quote:
Originally Posted by unlimit View Post
thanks for the reply but its not working.
It says "no such directory"
What I did -
Edit - kernel - then typed - single or 1 then - b - then - now i am in Single user mode - #- I typed your options - but nothing works- cat /etc/passwd (it says no such directory) - for passwd username - then enter - it shows blank space- then I have to boot it forcefully.
I'm not sure if the above (bold part) is correct. It could be that it is, but just to make sure:

- boot,
- press a key when grub appears,
- press e to edit (I assume that there is only one entry present, if more are present select the appropriate one),
- select kernel /vmlinuz-2.... line,
- press e to edit
- add single as last entry,
- press enter,
- press b
- system boots and there should not be any error messages.

You are now in single user mode as root user (no password is asked on RHEL systems) and have a bash shell. From this point on you should be able to use normal commands (like cat or passwd):
Code:
cat /etc/passwd
passwd <username>
If you still cannot access /etc/passwd, what is the output of the following command:
Code:
ls -l /etc/passwd*
You should see something like this:
Code:
-rw-r--r--. 1 root root 1111 Jul 21 10:25 /etc/passwd
-rw-r--r--. 1 root root 1058 Jul 21 10:25 /etc/passwd-
(bold parts may differ).
 
Old 10-23-2013, 07:55 AM   #5
unlimit
LQ Newbie
 
Registered: Oct 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hi,
Thanks for the reply.
I am new to this so I got confused what I did, I reinstall everything with default settings and now its OK.
Thank you!
BTW can you tell me where to look for Linux system administrative tutorials.

.
Quote:
Originally Posted by druuna View Post
You didn't answer my question: Can't you log in as root (after a normal boot)?
There's no need to go into single usermode when you can log in as root.

I'm not sure if the above (bold part) is correct. It could be that it is, but just to make sure:

- boot,
- press a key when grub appears,
- press e to edit (I assume that there is only one entry present, if more are present select the appropriate one),
- select kernel /vmlinuz-2.... line,
- press e to edit
- add single as last entry,
- press enter,
- press b
- system boots and there should not be any error messages.

You are now in single user mode as root user (no password is asked on RHEL systems) and have a bash shell. From this point on you should be able to use normal commands (like cat or passwd):
Code:
cat /etc/passwd
passwd <username>
If you still cannot access /etc/passwd, what is the output of the following command:
Code:
ls -l /etc/passwd*
You should see something like this:
Code:
-rw-r--r--. 1 root root 1111 Jul 21 10:25 /etc/passwd
-rw-r--r--. 1 root root 1058 Jul 21 10:25 /etc/passwd-
(bold parts may differ).
 
Old 10-23-2013, 08:11 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Quote:
Originally Posted by unlimit View Post
I reinstall everything with default settings and now its OK.
Thank you!
You're welcome.

BTW: Can you put up the [SOLVED] tag.
- above the first post -> Please Mark this thread as solved if you feel a solution has been provided.
- -or- -
- first post -> Thread Tools -> Mark this thread as solved

Quote:
Originally Posted by unlimit
BTW can you tell me where to look for Linux system administrative tutorials.
Here's one:
- 50 UNIX / Linux Sysadmin Tutorials (thegeekstuff)

Maybe one of my blogs could also help you (not just admin specific): Resources / References / Useful links
 
Old 10-24-2013, 03:11 AM   #7
unlimit
LQ Newbie
 
Registered: Oct 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Done as you said. Mark this thread as solved.
And I am looking for the exact tutorials for the courses that will qualify me to the Linux system administrative exam.
Will those blogs or links help me?
One more thing what is (Exams EX200 and EX300)?
Thank you!

Quote:
Originally Posted by druuna View Post
You're welcome.

BTW: Can you put up the [SOLVED] tag.
- above the first post -> Please Mark this thread as solved if you feel a solution has been provided.
- -or- -
- first post -> Thread Tools -> Mark this thread as solved

Here's one:
- 50 UNIX / Linux Sysadmin Tutorials (thegeekstuff)

Maybe one of my blogs could also help you (not just admin specific): Resources / References / Useful links

Last edited by unlimit; 10-24-2013 at 03:22 AM.
 
Old 10-24-2013, 03:53 AM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Quote:
Originally Posted by unlimit View Post
And I am looking for the exact tutorials for the courses that will qualify me to the Linux system administrative exam.

Will those blogs or links help me?

One more thing what is (Exams EX200 and EX300)?
Those are Red Hat certifications:
- RHCSA / EX200 - Exam objectives

After getting RHCSA you can do:
- RHCE / EX300 - Exam objectives

Red Hat doesn't care how you complete the tasks they give you as long as you complete (most of) them within the short time given. You can use any source while preparing for it. So my resource list could come in handy.

A more dedicated source would be this book: RHCSA/RHCE Red Hat Linux Certification Study Guide

BTW: These 2 certificates are based on showing practical knowledge you should already have learned over the years. Getting these certificates by cramming for the test over a short period of time is rather pointless. It will be obvious that you don't have the practical experience that should accompany these certificates.
 
  


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
[SOLVED] Change Display Manager in RHEL6 custangro Linux - Enterprise 4 10-22-2013 11:01 AM
[SOLVED] unable to reset root password in RHEL6 -rof- Red Hat 6 07-01-2012 08:50 AM
Change default video driver - RHEL6 ? Vilius Red Hat 1 06-25-2012 08:56 PM
RHEL6 can't setup GRUB in rescue mode go3mon Linux - Enterprise 2 07-19-2011 09:28 AM
rhel6 can't change password in recovery mode go3mon Linux - Enterprise 2 07-18-2011 10:20 AM


All times are GMT -5. The time now is 10:18 AM.

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