Yet another need to access a forgotten root password
Okay, I have read the other threads (nearly a dozen or so) and nothing of use has come from it. I have tried:
This is a system I set up, literally, years ago, with no need to touch it. It was originally set up as a file server, running SAMBA. I am wanting to add CUPS to it, and possibly a web server if it will handle the load. Currently, it is running Debian 4.0 without a GUI. My next step, if I can't get into the root account, is to install a new OS (and try to salvage the file shares that exist). I just would rather keep the install that I have, but I need to hack/crack or change my root password. Help??? |
Code:
but I need to hack/crack or change my root password. edit grub at boot prompt -> edit kernel line and append "init=/bin/bash" and boot machine. it will boot machine and give command prompt then you can change root password. tested on ubuntu 10.4 and debian lenny. hope this help. |
Very cool - yet, I get the following prompt:
Code:
root@(none):/# Code:
bash: passwd: command not found Code:
root@(none):/# passwd |
Give the full path of passwd command
Code:
/bin/passwd |
You are good, my friend, but this seems to be eluding both of us.
@ /bin there is no passwd @ /usr there is no ./bin (or I can't see it in this mode) The /bin directory has a limited (approx. 90) number of commands available. The /usr directory is (as far as this mode is concerned) empty. It seems that in order to access the directories I need, I need to be logged in as 'root@myBox' rather than 'root@(none)'. Or my system is hosed and I just haven't been able to accept that, as yet. |
perhaps you need to mount your /usr directory before you get "passwd"?
|
@HasC -
excellent recommendation!!! Now I've gotten to /usr/bin - and can run the passwd command. Issue is here is what I get: Code:
root@(none):/usr/bin# passwd Seriously, I want to thank you guys for taking the time to work with me. |
Can you edit /etc/sudoers in the mode you've gotten to by the init=/bin/bash mode? Perhaps you could create a new user and give that new user full sudo access. Then log in to that user and do a sudo passwd to change the root password.
But first, check that /var is mounted with write permission for "root." The "lock" may be being reported as busy because /var/lock is not writable. |
gvaught,
Run a live CD. Try the trick: Mount your old root drive. Edit /etc/passwd and add a new sudo user by editing /etc/sudoers Reboot into the old debian and find out if you can log in as a new sudo user. If you can then you will be able to do anything there as root. BTW you may need to delete some cached lock files first. Good luck. |
Quote:
|
HalC was getting you there;
Thanks to anticapitalista at anitX forums: 1. Append ‘init=/bin/bash’ {as done before} 2. Press Enter 3. Type mount -n -o remount,rw / (at prompt) 4. passwd 5. Follow steps to give yourself a new root password 5. reboot |
Quote:
Yes indeed. Sorry. Either I was drowsy or I was sleeping when I made the post. May you have luck. |
Quote:
|
Hmm... For a system with physical access that would be a pretty easy way to... never mind :D. I think remounting the system as rw as SalmonEater has said will do the trick. Please don't forget to mark this as solved when you already find it correct.
|
Make sure the root filesystem is mounted read-write before running password:
mount -o remount,rw / edit: oops sorry for the late reply ... I had an old version of the thread in my broswer cache, |
All times are GMT -5. The time now is 04:52 AM. |