Lost credentials / Locked out
To manage your VPS, you normally log in with your SSH key. However, you may lose access due to misconfiguration or a lost SSH key.
This chapter describes how to regain access. We describe two different methods.
Option 1: Modify init application
Normally, when a VPS is booted, a standard "init" application is run, which is responsible for the normal boot process.
It is possible to modify the "init" application and start a simple "shell" instead of the normal boot process. Once the shell is started, changes can be made to the file system.
How to change init
- Shutdown the VPS
- In the VPS panel, open the VPS and choose the configuration tab
- Select the update VPS button to change settings
- Open the advanced panel
- In the kernel parameters field add
- Click save
- Boot the system
After booting, you will be dropped in a shell directly and can use the console
on the panel to make changes. Please note, in most cases, the filesystem is
mounted in read-only, so it is not possible to save changes. To be able to
write changes to disk, execute the command
mount -o remount,rw /
After making the changes, remount in read-only again (
mount -o remount,ro /)
and shutdown the system from the panel.
As there is no full operating system started, the system does not listen to a normal shutdown command. A force shutdown is required.
After this, remove the extra kernel parameter again and boot the system normally.
Option 2: Make disk image available on an other VPS
Alternative, or if more changes need to be made where it is desired to be able to login from SSH, it is also possible to add the disk to an other VPS. With this method we create a recover VPS. From the recover VPS we can access the disk of the broken system and make changes
- Create a new (minimal) recover VPS, give it a clear name, like 'recover'
- Shutdown both the recover and broken VPS
- In the menu on the left choose Disk images
- Found the Disk Image of the broken VPS and choose manage
- Change the assigned VPS to the recover VPS one, and choose the second disk slot (Position 1, xvdb1)
- Save the changes
Now you can boot the recover VPS. You can login with SSH into that system and access the disk of the broken VPS. The disk will be at `/dev/xvdb1'.
You can mount the disk of the broken VPS and make changes on disk.