Docs / Getting Started / Setting Up a Non-Root User with Sudo

Setting Up a Non-Root User with Sudo

By Admin · Jan 18, 2026 · Updated Apr 25, 2026 · 7 views · 2 min read

Setting Up a Non-Root User with Sudo is a common requirement for VPS administrators. This guide provides practical instructions that you can follow on Ubuntu 22.04/24.04 or Debian 12, though most steps apply to other distributions as well.

Prerequisites

  • A Kazepute account (sign up at kazepute.com)
  • An SSH client installed on your computer
  • Root or sudo access to the server
  • Basic familiarity with the Linux command line

Initial Setup Steps

For production deployments, consider implementing high availability by running multiple instances behind a load balancer. This approach provides both redundancy and improved performance under heavy load.


# Connect to your VPS via SSH
ssh root@your-server-ip

# Update the system
sudo apt update && sudo apt upgrade -y

# Set the hostname
sudo hostnamectl set-hostname myserver

# Set timezone
sudo timedatectl set-timezone America/New_York

These commands should be run as root or with sudo privileges. If you're using a non-root user, prefix each command with sudo.

  • Use strong, unique passwords for all services
  • Enable firewall and allow only necessary ports
  • Keep all software components up to date
  • Set up fail2ban for brute force protection
  • Use SSH keys instead of password authentication

Configuring Your Environment

If you encounter issues during setup, check the system logs first. Most problems can be diagnosed by examining the output of journalctl or the application-specific log files in /var/log/.


# Create a non-root user
adduser deploy
usermod -aG sudo deploy

# Set up SSH key authentication
mkdir -p /home/deploy/.ssh
chmod 700 /home/deploy/.ssh
nano /home/deploy/.ssh/authorized_keys
chmod 600 /home/deploy/.ssh/authorized_keys
chown -R deploy:deploy /home/deploy/.ssh

The output should show the service running without errors. If you see any warning messages, address them before proceeding to the next step.

  • Start with the minimum required resources
  • Use connection pooling for database connections
  • Profile before optimizing - measure first
  • Scale vertically before scaling horizontally
  • Implement caching at every appropriate layer

Next Steps

With non-root now set up and running, consider implementing monitoring to track performance metrics over time. Regularly review your configuration as your workload changes and scale resources accordingly.

Was this article helpful?