Jump to content

Reset Password Ubuntu Server


Recommended Posts

Guest richard_s
Posted

We are looking at taking over the IT support for a local firm who have a basic Ubuntu file server installed. The problem is that the previous support firm will not give the client the password for the server which means no one can access it to do either maintenance or any other work on it that needs doing.

 

I have some knowledge of linux but removing a password is beyond my capabilities without help.

Posted
We are looking at taking over the IT support for a local firm who have a basic Ubuntu file server installed. The problem is that the previous support firm will not give the client the password for the server which means no one can access it to do either maintenance or any other work on it that needs doing.

 

I have some knowledge of linux but removing a password is beyond my capabilities without help.

 

If you boot from a Linux CD (the original Ubuntu CD will do it) it should mount all pre-existing drives including the one which holds the /etc directory. Supposing it mounts the drive in location /mnt/drive1, you would need to go edit (as root) the /mnt/drive1/etc/shadow file to remove the root passwd.

 

root:$1$b62f6698$5Xrs/t0cxojBTrgyEXOVc1:14547:0:99999:7:::

 

becomes

 

root::14547:0:99999:7:::

 

Then you should be able to reboot without the CD and log in as root without giving a password. Then type "passwd" at a shell and enter a new one.

 

I used to use Knoppix for this, but that was a few years ago.

 

--

Simon

Posted

m0nty's is correct, but usually root is locked out on Ubuntu so you may need to find the admin user.

 

Use live cd, Knoppix/Ubuntu....

Mount existing root drive to /mnt/drive1

List all admin users

$ grep admin /mnt/drive1/etc/group

"admin:x:123:andyp"

Edit "andyp" password in /mnt/drive1/etc/shadow as suggested by m0nty.

 

Reboot and log in as the admin user "andyp" and you will be able to use sudo etc...

 

 

Andy

Posted
but usually root is locked out on Ubuntu

 

Well, root is given a random password, which you can change if you want. On a new Ubuntu install, the first thing I generally do is "sudo bash" then "passwd" to change the root password to I can log in as root via SSH. By default you can't log in as root from the GUI, but I think you can overide that, too.

 

--

David Hicks

Posted

Well why not use the old way and see if it works. I guess your using GRUB as your bootloader so when you see grub being used as the system is booting up stop it there. Got to the latest kernel in the list and press 'e' for edit. You can then edit the line which should look something like

kernel /boot/vmlinuz-2.6.15-26-386 root=/dev/hda1 ro quiet splash

 

Type

init=/bin/bash

at the end. Press enter to save it and then press 'b' to boot. It should then boot into single user mode where you can just use the password command 'passwd' to change your root password.

 

If this doesn't work then I would go with the live cd to edit /etc/shadow as well.

  • Thanks 1
Posted
Well why not use the old way and see if it works. I guess your using GRUB as your bootloader so when you see grub being used as the system is booting up stop it there. Got to the latest kernel in the list and press 'e' for edit. You can then edit the line which should look something like
kernel /boot/vmlinuz-2.6.15-26-386 root=/dev/hda1 ro quiet splash

Type

init=/bin/bash

at the end. Press enter to save it and then press 'b' to boot. It should then boot into single user mode where you can just use the password command 'passwd' to change your root password.

 

If this doesn't work then I would go with the live cd to edit /etc/shadow as well.

 

I like this method, Just tried in on my Ubuntu 9.10Server (VirtualBox) and it worked a treat!!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...