Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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????
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.
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.
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.
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.
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.
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.
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.
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.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.