Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

root user password reset to connect through SSH on Sandbox 2.6

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

Expert Contributor

I am able to get in with my old password.

View solution in original post

9 REPLIES 9

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.

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

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.

Super 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

Expert Contributor

I used this command to change my password.

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.

Super 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/

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.

Expert Contributor

I am able to get in with my old password.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.