π What We'll Cover
β¨ Create a non-root user
π‘οΈ Add the user to the sudo group
π Optionally copy SSH keys for secure access
βοΈ Improve security and verify configuration
These are foundational tasks for a safe, stable, and hacker-resistant server environment π°π
β Why These Steps Matter
Using the root account all the time is like driving a Ferrari with no seatbelt at full speed β fun, but dangerous π
Creating a dedicated user with sudo privilege improves:
π Security β Limits damage from accidental commands
π§Ύ Accountability β Track who did what
π΅οΈ Auditability β Better logging and compliance
βοΈ Access control β Fine-grained permissions
SSH keys also give you passwordless login, making your workflow smoother and more secure.
π₯οΈ Initial Server Access
Connect to your VPS using the credentials provided by your hosting provider:
ssh root@your-server-ip
Once logged in, proceed with the setup below.
π€ Create a New User
Run this to create a new user:
sudo adduser username
You'll be asked for:
- π Password
- π Optional user info (totally skippable)
To skip all prompts except password:
sudo adduser --gecos "" username
π οΈ Add the User to the Sudo Group
Grant administrative privileges:
sudo usermod -aG sudo username
Confirm:
groups username
You should see:
username sudo
Boom! Your user now has superpowers β‘
π (Optional) Copy Your SSH Key to the Server
π΅οΈ Check if you already have an SSH key
On your local machine, run:
ls ~/.ssh/id_ed25519.pub
If not, generate one like a pro:
ssh-keygen -t ed25519
π€ Copy your key to the server
Simplest method:
ssh-copy-id username@your-server-ip
Manual method (ninja mode π₯·):
cat ~/.ssh/id_ed25519.pub | ssh username@your-server-ip "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"
π§ͺ Test SSH Login
Test access:
ssh username@your-server-ip
If it logs in without asking for a password β π₯³π
Your SSH keys are working perfectly.
π (Optional) Disable Password Authentication
β οΈ Warning: Only do this if key authentication works β or you might lock yourself out like losing your house keys outside ππͺ
Edit SSH config:
sudo nano /etc/ssh/sshd_config
Set:
PasswordAuthentication no
Reload SSH service:
sudo systemctl reload ssh
πΎ Verify Storage & System Resources
Check available disk space:
df -h
Expected output showing your 120GB storage:
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 118G 2.1G 110G 2% /
Check RAM:
free -h
Expected output showing ~8GB RAM:
total used free
Mem: 7.8G 500M 7.0G
Check CPU cores:
nproc
Should return: 4
π Summary Checklist
| Step | Purpose |
|---|---|
| π€ Create user | Avoid root login |
| π‘οΈ Add sudo group | Admin privileges |
| π Copy SSH keys | Secure access |
| π§ͺ Test login | Prevent lockouts |
| π Disable password auth | Extra hardening |
| πΎ Verify resources | Confirm server specs |
π― Final Thoughts
Once this setup is complete, your 4-core, 8GB RAM, 120GB Ubuntu server is ready for:
π³ Docker / Podman β Container runtime
π§ Automation scripts β Ansible, Terraform
β‘ CI/CD pipelines β Jenkins, GitLab CI
βΈοΈ Kubernetes / K3s / MicroK8s clusters β Perfect specs for lightweight K8s
π οΈ DevOps experimentation β n8n, ArgoCD, monitoring stacks
Your VPS has enough resources to comfortably run a MicroK8s cluster with multiple services while maintaining good performance.
π What's Next?
Ready to install Kubernetes? π
π Continue to Part 2: Installing MicroK8s on Ubuntu 24.04+
In Part 2, you'll learn how to:
- β¨ Install MicroK8s via Snap
- π Configure user permissions
- π§° Enable essential add-ons (DNS, storage, ingress)
- π§ͺ Verify the cluster is running
- π³ Deploy a test NGINX application
- π Ensure MicroK8s auto-starts on boot
Let's turn your server into a Kubernetes powerhouse! βΈοΈ
Top comments (0)