This article addresses issue related to obtaining root access on Crusoe Cloud VMs and logging in directly using root user. During VM provisioning via the Crusoe Cloud UI console, SSH keys are automatically associated with the ubuntu
default user, this user is granted sudo
privileges to execute root-level commands.
Note: The default user for all ubuntu
based images is ubuntu
. root
access is considered to be deprecated, and you will be warned on login.
Prerequisites
- A VM provisioned with the
ubuntu
user as the default account - SSH keys provided for user authentication
Solution
-
SSH in to the VM using the
ubuntu
user and the associated SSH key.ssh -i <ssh-key> ubuntu@<server-ip>
- Use the
sudo su
command to switch to theroot
user .
sudo su
- Navigate to the
root
user’s.ssh
directory.
cd /root/.ssh
-
If the
.ssh
directory does not exist, create it:mkdir -p /root/.ssh && chmod 700 /root/.ssh
- Open the
authorized_keys
file in a text editor and append the provided SSH key, then save and exit the editor .
vi authorized_keys
ssh-rsa SDLNKDFNDSKJNF..... - Set the appropriate permissions for the file:
chmod 600 authorized_keys
-
Open a new terminal session and log in directly as the
root
user using the SSH key.
Note:
- Ensure that all changes to SSH configuration maintain security best practices.
- We recommend using the Crusoe CLI for streamlined VM and resource management.
- Mismanagement of root access or SSH keys can lead to security vulnerabilities. Always back up critical configuration files before making changes.
Comments
0 comments
Please sign in to leave a comment.