LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-19-2011, 03:01 PM   #1
saurabhpandey39
LQ Newbie
 
Registered: Nov 2010
Posts: 9

Rep: Reputation: 0
forgot root passwd


hi,
i forgot my root passwd.i am using mandriva spring and i disabled the safe mode.
can anyone help me, how to retrieve root account without using any cd????
 
Old 10-19-2011, 03:30 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Boot into the second choice in the "Boot screen" :
Start Mandriva Linux 201X.x ( safe .... )

When you come to a command prompt, please type : passwd

... And you can enter a new password.

EDIT : Overlooked, that you have disabled that function.
Suggest : Use the live cd to enable 'safe boot' again.

..

Last edited by knudfl; 10-19-2011 at 03:34 PM.
 
Old 10-19-2011, 03:46 PM   #3
saurabhpandey39
LQ Newbie
 
Registered: Nov 2010
Posts: 9

Original Poster
Rep: Reputation: 0
i wrote here that i can not use any cd
 
0 members found this post helpful.
Old 10-19-2011, 04:29 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by saurabhpandey39 View Post
i wrote here that i can not use any cd
How did you do the installation, without being able to use a CD/DVD??

Boot from whatever it was you did the installation with, then drop to single-user mode, and reset the password.
 
Old 10-20-2011, 02:11 AM   #5
saurabhpandey39
LQ Newbie
 
Registered: Nov 2010
Posts: 9

Original Poster
Rep: Reputation: 0
i installed it with a cd but i am saying that if there is any way to change the root passwd without cd and safe mode because some did it with my system.
 
0 members found this post helpful.
Old 10-20-2011, 10:04 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by saurabhpandey39 View Post
i installed it with a cd but i am saying that if there is any way to change the root passwd without cd and safe mode because some did it with my system.
Yes...while the system is UP, you log in to it (either as root, or SU to root), and type in "passwd".

If you want to change it back and don't know it, you boot into safe mode or to CD, and change it.
 
1 members found this post helpful.
Old 10-20-2011, 12:40 PM   #7
saurabhpandey39
LQ Newbie
 
Registered: Nov 2010
Posts: 9

Original Poster
Rep: Reputation: 0
please read the problem before posting any reply. i wrote that i did not know the root passwd, safe mode is disabled and i can't use any cd to recover it. is there any other way to get access back to root account?

Last edited by saurabhpandey39; 10-20-2011 at 12:41 PM.
 
0 members found this post helpful.
Old 10-20-2011, 12:51 PM   #8
spankbot
Member
 
Registered: Aug 2007
Posts: 133

Rep: Reputation: 16
Quote:
Originally Posted by saurabhpandey39 View Post
i installed it with a cd but i am saying that if there is any way to change the root passwd without cd and safe mode because some did it with my system.
Short answer to your question: NO.

Theoretically you could assess the system and try to locate a security vulnerability, then exploit that to gain root privs. But this process is not for beginners and is _very_ time consuming.
 
Old 10-20-2011, 01:03 PM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by saurabhpandey39 View Post
please read the problem before posting any reply. i wrote that i did not know the root passwd, safe mode is disabled and i can't use any cd to recover it. is there any other way to get access back to root account?
Please read (and UNDERSTAND) the replies.

You asked TWO questions at different times. First post:
Quote:
Originally Posted by saurabhpandey39
i forgot my root passwd.i am using mandriva spring and i disabled the safe mode.can anyone help me, how to retrieve root account without using any cd????
Based on that, you were told NO. If you can't boot to safe mode, and can't boot from CD/DVD, you have ZERO options.

From post 5
Quote:
Originally Posted by saurabhpandey39
i installed it with a cd but i am saying that if there is any way to change the root passwd without cd and safe mode because some did it with my system.
...which makes it sound like you DO have a CD/DVD drive to boot from (hence the live CD option presented in the FIRST REPLY to you), but someone then changed the password on the system, to something you don't know. You asked "is there any way to change the root passwd without cd and safe mode". That question was answered by telling you HOW.

Again....you have NO OPTIONS if you don't know the root password, other than booting from install media and going to rescue mode. The ONLY possibility is that if your regular user account is in the SUDO'ers file, you can run "sudo passwd root", and reset it that way.
 
Old 10-20-2011, 02:26 PM   #10
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
Can you boot from a USB flash drive?
 
Old 10-20-2011, 02:31 PM   #11
thezerodragon
Member
 
Registered: Apr 2009
Location: Paris, France
Distribution: Fedora 12 Constantine
Posts: 142

Rep: Reputation: 44
Quote:
The ONLY possibility is that if your regular user account is in the SUDO'ers file, you can run "sudo passwd root", and reset it that way.
and if there isn't one, you use
Code:
echo
to add your username to the sudoers file.


I was mistaken- see below.

Last edited by thezerodragon; 10-20-2011 at 04:40 PM. Reason: incorrect
 
0 members found this post helpful.
Old 10-20-2011, 04:02 PM   #12
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by thezerodragon View Post
and if there isn't one, you use
Code:
echo
to add your username to the sudoers file.
Uhh...no, you can't, sorry.

The sudoers file is 440, owned by root/root:
Code:
-r--r----- 1 root root 2134 Mar 24  2011 sudoers
Unless you ARE root, you can't change the permissions on the file to put ANYTHING else into it. Even if you could do it with an echo statement, you'd have to use the exact correct syntax, then change the file BACK to being owned by root/root with the right permissions, otherwise sudo won't work AT ALL. And, you'd ALREADY have to be root (or equivalent), to do it, either with an echo statement or through vi.

The only 'correct' way is to edit the file with visudo...which again, you'd have to be root to run, or running as equivalent to root. And if the OP could do that, they could just reset the root password without doing ANY of those things.
 
Old 10-20-2011, 04:38 PM   #13
thezerodragon
Member
 
Registered: Apr 2009
Location: Paris, France
Distribution: Fedora 12 Constantine
Posts: 142

Rep: Reputation: 44
Unhappy

Quote:
Unless you ARE root, you can't change the permissions on the file to put ANYTHING else into it. Even if you could do it with an echo statement, you'd have to use the exact correct syntax, then change the file BACK to being owned by root/root with the right permissions, otherwise sudo won't work AT ALL. And, you'd ALREADY have to be root (or equivalent), to do it, either with an echo statement or through vi.
You're right, I'm sorry. I've used
Code:
echo
with the correct syntax to add to the sudoers file before, but while logged in as root. If I had thought that last post through I would have realized that.
 
1 members found this post helpful.
Old 10-20-2011, 05:33 PM   #14
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
If one can boot from an USB-device (any distribution) it should be possible to chroot into the Linux-system and then change the password. After a chroot you are root and therefore have the appropriate permissions.

Markus
 
Old 10-20-2011, 06:21 PM   #15
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Dear well-intending friends,

The OP asked one question before this one, almost a year ago. This question was about how to change the contents of a file while keeping the MD5 sum equal. Despite of several requests for explanation as to why he wanted to do this, the question was never answered.

Now, almost a year later, he is asking how to crack open a box which is so severely secured that safe boot is disabled, and there is no way of external booting, and he forgot the root password. Yeah right, you disable every emergency entry and then you forget the root password.

I would recommend that we (myself not excluded) show a more prudent distrust in sparse posters with unlikely security breach questions.

jlinkels
 
5 members found this post helpful.
  


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
Forgot root passwd!! :-( tomthebomb3 Linux - Newbie 10 10-29-2007 11:07 PM
Forgot my root passwd k1ll3r_x SUSE / openSUSE 23 04-06-2005 12:44 PM
forgot root passwd sanu Linux - Newbie 2 09-21-2004 02:07 AM
forgot root passwd sanu Linux - Newbie 1 09-20-2004 04:45 AM
FORGOT root passwd WannaLearnLinux Linux - Newbie 5 03-30-2004 12:36 AM

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

All times are GMT -5. The time now is 11:58 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