In an emergency mode SSH session, you can change the apparent root to your VPS mounted disk to simulate a typical login scenario. This enables you to execute commands and perform actions on your VPS, offering a way to address issues or manage resources directly within the disk environment.
To change the apparent root, use the command below:
Make sure to replace /path/to/mainpartition with your VPS disk main partition mounted directory. You can locate the directory by referring to this guide: VPS Emergency Mode: Where to Find Files.
A successful execution of the command won't display any error messages. Your terminal window will display the prompt for entering a new command:
To verify the change was applied, run the following command:
unshare -U true
If you encounter an
unshare: unshare failed: Operation not permitted error, it indicates the apparent root was successfully changed, and subsequent commands will utilize the resources from your mounted VPS disk.