Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I lost the password for my OpenVZ container(actually I was using private key ssh but lost the file, so after setup I never logged in with root password) but I still have root access on the host machine, I'm not running HyperVM anymore, When I was it was just a matter of su vm1 or whatever vm user, and it would drop me into the containers root shell. How do I get there from pure OpenVZ? Or just reset the root password like I used to be able to do with HyperVM. This OpenVZ is not managed by any other OpenVZ gui based manager either.

share|improve this question
add comment

1 Answer 1

Are your openvz running? If so, try:

vzctl enter $vz_ID

wher $vz_ID is the container ID (output of vzlist). This will give you root access and you will then be able to change your password.

Anyway, with root access on the host, you can always edit the passwd and shadow files located at /vz/private/$vz_ID/etc/passwd and /vz/private $vz_ID/etc/shadow to change passwords.

share|improve this answer
    
I usually change the root password of a running CT in one step from the HN: vzctl CTID exec passwd –  Bruno9779 May 12 at 13:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.