LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to rescue/change password in RHEL6 under VirtualBox? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-rescue-change-password-in-rhel6-under-virtualbox-4175480856/)

unlimit 10-15-2013 07:25 AM

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!

druuna 10-15-2013 07:35 AM

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)

unlimit 10-17-2013 04:18 AM

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 (Post 5046052)
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)


druuna 10-17-2013 05:53 AM

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 (Post 5047362)
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).

unlimit 10-23-2013 06:55 AM

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 (Post 5047387)
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).


druuna 10-23-2013 07:11 AM

Quote:

Originally Posted by unlimit (Post 5050865)
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

unlimit 10-24-2013 02:11 AM

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 (Post 5050869)
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


druuna 10-24-2013 02:53 AM

Quote:

Originally Posted by unlimit (Post 5051327)
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.


All times are GMT -5. The time now is 09:01 PM.