Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

root user password reset to connect through SSH on Sandbox 2.6

avatar
Expert Contributor

Hi,

Could anyone please let me know how to reset password for root user to connect via ssh?

Thanks,

Satish.

1 ACCEPTED SOLUTION

avatar
Expert Contributor

I am able to get in with my old password.

View solution in original post

9 REPLIES 9

avatar
Guru

Hi @Satish Sarapuri

See this thread: https://community.hortonworks.com/questions/67916/reset-root-password-on-docker-sandbox.html

If you find this post useful, please "accept" the answer.

avatar

Adding to the response. Take a look at the step-by-step instructions by @S Mahapatra in the link that Sonu provided.

avatar
Expert Contributor

this link provide details on how to reset password for other users, not for root user. I want to reset password for "root" user.

avatar
Master Mentor

@Satish Sarapuri

Login to the docker instance as root with default password as "hadoop"

ssh root@127.0.0.1 -p 2222

.

The you can use "passwd" command to reset the password.

# passwd

avatar
Expert Contributor

I used this command to change my password.

avatar
Expert Contributor

@Jay SenSharma

Earlier, I have changed the default password "hadoop" to other password and forgot the changed one. Now,I want to reset the new password.

I tired with this default password "hadoop", but no luck.

avatar
Master Mentor

@Satish Sarapuri

At the Docker Level:

Did you try the following:

$PASS='YOUR_NEW_PASSSWORD'
echo -e "$PASS\n$PASS" | sudo docker exec -i <container-id-or-name> passwd

Or may be docker command option "RUN echo newtestpassword | passwd root" in a Dockerfile

At the OS level:

In single user mode you should be able to do so. Can you please try this: https://www.liberiangeek.net/2014/09/reset-forgotten-root-password-centos-7-servers/

avatar
Expert Contributor

@Jay SenSharma,

To execute these commands, I have to get onto terminal ,to get on to terminal i have to use root or super other user credentials, but i have only root user and i am trying to reset the password for the same. Please let me know if I am missing anything here or is there any other way to acheive the same.

avatar
Expert Contributor

I am able to get in with my old password.