How to reset a Slice root password

Although we should never log in as the root user, there is the odd occasion when this might be necessary.

That's all well and good, but what happens if you have lost the root password and you just can't login without it? Well, the SliceManager has a handy 'Reset Root Password' feature for just such eventualities.


Why?

One example of why you would need to reset the root password is if you are locked out of your system (say by a configuration error in your SSH or iptables files) and you haven't yet created a privileged user.

In such cases, when you can't remember the root password, there is simply no way of accessing your Slice.

Log in

First thing is to log into the SliceManager where you will be faced with the default 'Slices' view:

As you can see, I have one 256 Slice named 'Slice1'.

Details

Click on your slice name to access the slice summary and control panel:

Rescue

Next, click the 'Rescue' link to access the Reset Password page:

Now click the 'Reset Root Password' button.

Note: This procedure will involve a reboot of the slice.

You will be sent back to the summary page where 'Running Action' shows 'password' in red - indicating the process is being completed.

It will also show you what the new password will be.

Email

Once the procedure has been completed, you will be sent a confirmation email with a reminder of the new password.

I advise waiting for this email before you try and log in with the new password.

Console

Once you get the email, click on the 'Console' tab in the SliceManager so you can log in and change the root password to one of your choosing.

passwd

Launch the console and log in as root with the new password.

To reset the password to one of your choosing simply enter the following command:

passwd

Enter your chosen password and then confirm it.

Done

That's it.

The whole procedure takes a couple of minutes at the most.

Summary

Losing your Slice root password can cause no end of issues if you have no other way of accessing your Slice.

Using the SliceManager, such eventualities are easily taken care of by clicking the 'Reset Root Password' link.

PickledOnion.

Article Comments:

Bob commented Tue Oct 13 18:21:46 UTC 2009:

Mr Pickle,

Im having an issue. I have a few slices with you guys and have never really had a problem. Im trying to set my root password by typing passwd etc...

but when i log out and try to ssh back in i get a permission denied?

any ideas on what i may be doing wrong?

matiu commented Wed Oct 14 04:17:30 UTC 2009:

I'll bet that the Slice is configured to not allow root access via SSH. It should work from the web console though still.

As part of the first page of Slice setup articles, we recommend denying root access via ssh, as a security precaution.

So the quick answer is to log in with the web console, then change the SSH settings to do what you need.

Want to comment?


(not made public)

(optional)

(use plain text or Markdown syntax)