User`s guide
Operations on Virtual Private Servers 36
Setting root Password for VPS
By default, the root account is locked in a newly created VPS, and you cannot log in. In order to
log in to the VPS, it is necessary to create a user account inside the Virtual Private Server and
set a password for this account or unlock the root account. The easiest way of doing it is to run:
# vzctl start 101
[This command starts VPS 101, if it is not started yet]
# vzctl set 101 --userpasswd root:test
In this example, we set the root password for VPS 101 to “test”, and you can log in to the
Virtual Private Server via SSH as root and administer it in the same way as you administer a
standalone Linux computer: install additional software, add users, set up services, and so on.
The password will be set inside the VPS in the
/etc/shadow file in an encrypted form and
will not be stored in the VPS configuration file. Therefore, if you forget the password, you have
to reset it. Note that
--userpasswd is the only option of the vzctl set command that
never requires the
--save switch, the password is anyway persistently set for the given Virtual
Private Server.
While you can create users and set passwords for them using the
vzctl exec or vzctl
set
commands, it is suggested that you delegate user management to the Virtual Private Server
administrator advising him/her of the VPS root account password.