How to configure and use SSH key authentication with a non-root user account on Vultr instances for secure access with sudo privileges
Vultr supports deploying instances with a limited non-root user, typically named linuxuser
, by enabling the Limited User Login feature. This allows you to log in securely with your SSH key and elevate privileges via sudo
when necessary.
To use an SSH key with a non-root user:
Add an SSH public key to your Vultr account.
During deployment, select the added SSH key and enable Limited User Login. This creates a non-root user (e.g., linuxuser
) on the instance and injects the SSH key into that user's ~/.ssh/authorized_keys
file.
After deployment, log in using the assigned non-root user and the instance's public IP address:
$ ssh linuxuser@<instance_ip>
Use sudo
to escalate privileges when needed.
This approach improves security by minimizing root access and enforcing the principle of least privilege on your server. For detailed deployment instructions, refer to Vultr’s Limited User Login guide.