Close Menu
  • Home
  • Life style
    • Celebrities
    • Exercise & Training
    • Healthline
  • Exploration
    • Beauty tips
    • Business
    • Travel guides
    • Fashion
    • Technology
  • Web tutorials
    • Hosting & Servers
    • Blogger guides
    • WordPress guides
  • English
    • Tiếng Việt
    • Hmoob
    • English
Facebook YouTube X (Twitter) Instagram
Trending
  • Protecting Servers Against AI Attacks: From Identity to the Supply Chain
  • Late-Summer Travel in Vietnam 2026: Plan a Less Crowded, Less Rainy Itinerary
  • Protecting WordPress Against AI Bots and Unknown Crawlers
  • Install Let’s Encrypt SSL on Ubuntu with OpenLiteSpeed and Automatic Renewal
  • AI-Powered Operational Optimization for Small Businesses: A 30-Day Testing Framework
  • Optimizing a Blog for Google AI Overviews and AI Mode
  • Diagnosis and Treatment of Severe Pneumonia: CAP, HAP, VAP, and Aspiration Pneumonia
  • How to Build a Newsletter for Your Blog: WordPress, Substack, or an Email Platform?
Facebook YouTube X (Twitter) Instagram
SaibABCSaibABC
Chú thích cho quảng cáo
  • Home
  • Life style
    1. Celebrities
    2. Exercise & Training
    3. Healthline
    4. View All

    Comparing Lionel Messi and Cristiano Ronaldo: Their Complete Careers

    30/08/2026

    Celebrities Move to Video Podcasts: The New Era of Talk Shows

    30/08/2026

    Taylor Swift Protects Her Voice Against AI: The Fight Against Deepfakes

    30/08/2026

    15 Most Popular Celebrities in the World of All Time

    30/08/2026

    Five-Minute Office Exercises: A Snack-Sized Movement Schedule

    30/08/2026

    Best Exercises to Strengthen Your Core: From Beginner to Advanced

    30/08/2026

    Diagnosis and Treatment of Severe Pneumonia: CAP, HAP, VAP, and Aspiration Pneumonia

    30/08/2026

    Preventing Dengue at Home: A Mosquito Control and Severe Symptom Checklist

    30/08/2026

    Self-Directed Health with Wearables: Use Data Correctly, Do Not Self-Diagnose

    30/08/2026

    Empowering Health: Prioritize Early Cancer Screenings for Better Well-being

    30/08/2026

    Diagnosis and Treatment of Severe Pneumonia: CAP, HAP, VAP, and Aspiration Pneumonia

    30/08/2026

    Preventing Dengue at Home: A Mosquito Control and Severe Symptom Checklist

    30/08/2026

    Preparing for the Business Peak Season: Capacity, Staffing, and Cash Flow Spreadsheet

    30/08/2026

    Comparing Lionel Messi and Cristiano Ronaldo: Their Complete Careers

    30/08/2026
  • Exploration
    1. Beauty tips
    2. Business
    3. Travel guides
    4. Fashion
    5. Technology
    Featured

    Late-Summer Travel in Vietnam 2026: Plan a Less Crowded, Less Rainy Itinerary

    By Nuj Coom30/08/2026
    Recent

    Late-Summer Travel in Vietnam 2026: Plan a Less Crowded, Less Rainy Itinerary

    30/08/2026

    AI-Powered Operational Optimization for Small Businesses: A 30-Day Testing Framework

    30/08/2026

    How to Block OTA Updates on iPhone and iPad Using Block OTA

    30/08/2026
  • Web tutorials
    1. Hosting & Servers
    2. Blogger guides
    3. WordPress guides
    4. View All

    Protecting Servers Against AI Attacks: From Identity to the Supply Chain

    30/08/2026

    Install Let’s Encrypt SSL on Ubuntu with OpenLiteSpeed and Automatic Renewal

    30/08/2026

    How to Install the LAMP Stack: Linux, Apache, MySQL, and PHP on Ubuntu

    30/08/2026

    How to secure Apache with Let’s Encrypt on Ubuntu

    30/08/2026

    Optimizing a Blog for Google AI Overviews and AI Mode

    30/08/2026

    Repurposing Blog Content: Turn One Article into 5 Formats

    30/08/2026

    12 Best AI Content Writing Tools for Bloggers in 2026

    30/08/2026

    How to Get Your Blog Into Google Discover After the Google Discover Core Update 2026

    30/08/2026

    Protecting WordPress Against AI Bots and Unknown Crawlers

    30/08/2026

    How to Install the LAMP Stack: Linux, Apache, MySQL, and PHP on Ubuntu

    30/08/2026

    12 Best AI Content Writing Tools for Bloggers in 2026

    30/08/2026

    Check WordPress Plugins Before Updating: A 24-Hour Process

    30/08/2026

    Protecting Servers Against AI Attacks: From Identity to the Supply Chain

    30/08/2026

    Protecting WordPress Against AI Bots and Unknown Crawlers

    30/08/2026

    Install Let’s Encrypt SSL on Ubuntu with OpenLiteSpeed and Automatic Renewal

    30/08/2026

    Optimizing a Blog for Google AI Overviews and AI Mode

    30/08/2026
  • English
    • Tiếng Việt
    • Hmoob
    • English
SaibABCSaibABC
Home»Web tutorials»Hosting & Servers»Optimize Security and Performance with Ubuntu Server: Initial Configuration Guide
Hosting & Servers 4 Mins ReadNo Comments

Optimize Security and Performance with Ubuntu Server: Initial Configuration Guide

Nuj CoomBy Nuj Coom
Facebook Twitter Pinterest LinkedIn Tumblr Email
Chú thích cho quảng cáo

Contents

  1. Introduction: Configuring Ubuntu Server
  2. Step 1 — Log in via SSH
  3. Step 2 — Create a new user
  4. Step 3 — Grant administrative privileges with sudo
  5. Step 4 — Configure the UFW firewall
  6. Step 5 — Enable SSH for regular users
  7. Conclusion: Ubuntu Server Configuration
  8. References

Introduction: Configuring Ubuntu Server

After deploying a new Ubuntu server, prioritizing foundational configuration is essential for improving both security and manageability. The steps below apply to a newly installed Ubuntu Server system; Ubuntu documentation currently targets the latest LTS release, Ubuntu 26.04 LTS (according to ubuntu.com). If you are using Ubuntu 24.04 or 22.04 LTS, the basic command names in this guide remain similar.

Step 1 — Log in via SSH

You need to know the server’s public IP address and have the corresponding password or private key. Log in via SSH using the account created by the provider or installer:

ssh username@your_server_ip

SSH provides an encrypted remote control connection through OpenSSH (according to ubuntu.com).

Note about root: Ubuntu usually disables direct login with the root account by default. Instead of using root for everyday tasks, use a regular account and temporarily elevate privileges with sudo. This follows the principle of least privilege and makes administrative actions easier to audit (according to ubuntu.com).

Step 2 — Create a new user

If the system does not yet have a regular administrative account, replace sammy with the username you want to create:

Chú thích cho quảng cáo
sudo adduser sammy

Set a strong password. Additional information such as the full name or phone number can be left blank if not needed. On some cloud servers, the initial account is created during deployment, so you can skip this step.

Step 3 — Grant administrative privileges with sudo

Add the new user to the sudo group so they can run individual administrative commands when needed:

sudo usermod -aG sudo sammy

Log out and log back in for the session to recognize the new group. When administrative privileges are needed, place sudo before the command, for example:

sudo command_to_run

Ubuntu identifies the sudo group as the group permitted to execute commands with administrative privileges (according to ubuntu.com).

Step 4 — Configure the UFW firewall

UFW is the default firewall tool, simplifying the management of traffic-filtering rules on Ubuntu. Before enabling the firewall, allow the SSH port in use to avoid locking yourself out of remote access (according to documentation.ubuntu.com).

sudo ufw allow OpenSSH
sudo ufw enable

Enter y and then press ENTER when prompted. Check the status with:

sudo ufw status verbose

If the SSH service uses a different port, allow that port instead of using the OpenSSHprofile, for example:

sudo ufw allow 2222/tcp

Open only the ports that the application actually needs. For example, a web server typically needs HTTP and HTTPS:

sudo ufw allow http
sudo ufw allow https

You can view the available application profiles with:

sudo ufw app list

To restrict SSH to a trusted administrative IP address, use a specific rule, for example:

sudo ufw allow proto tcp from YOUR_ADMIN_IP to any port 22

Replace YOUR_ADMIN_IP with the actual IP address and verify again with sudo ufw status numbered.

Step 5 — Enable SSH for regular users

Log out of the current session or open a new terminal window, then try connecting with the new account:

ssh sammy@your_server_ip

If password authentication is enabled, the system will request the password for sammy. If using an SSH key, ensure that the public key is in /home/sammy/.ssh/authorized_keys and that the directory permissions are appropriate. Do not blindly copy the entire .ssh directory from root; distribute the correct key to the correct user and check ownership.

After logging in, check sudo privileges:

sudo whoami

The expected result is root. If the server allows multiple users, you can restrict the accounts permitted to use SSH with a dedicated group and the AllowGroups option in the OpenSSH configuration (according to ubuntu.com).

For greater security, check the SSH configuration before applying changes:

sudo sshd -t
sudo systemctl reload ssh

Disable password or root login only after confirming key-based access or ensuring that you have backup console access. An incorrect SSH configuration can lock you out of the server.

Also read: How to Install WordPress on Ubuntu with the LAMP Stack

Conclusion: Ubuntu Server Configuration

Creating a non-root account, granting controlled sudo privileges, securing access with SSH, and opening only the necessary ports with UFW are essential foundations for a secure, manageable Ubuntu server. After completing these steps, continue updating the system, monitoring logs, and deploying protections appropriate for your actual application.

References

  • Ubuntu Server — Official Download Page
  • Ubuntu Server — OpenSSH Server
  • Ubuntu Server — Firewall and UFW
  • Ubuntu Server — User Management
  • Ubuntu Server — Managing Accounts and SSH Permissions

Chú thích cho quảng cáo
Linux Server Security SSH Ubuntu Ubuntu Server UFW
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Previous ArticleCloud Repatriation for Websites: When Should You Move to a VPS or Bare Metal?
Next Article Kubernetes for Small and Medium-Sized Websites: When to Use Managed Hosting Instead of a Self-Managed VPS
Nuj Coom
  • Website
  • Facebook
  • X (Twitter)
  • Instagram

Related Posts

Protecting Servers Against AI Attacks: From Identity to the Supply Chain

30/08/2026

Install Let’s Encrypt SSL on Ubuntu with OpenLiteSpeed and Automatic Renewal

30/08/2026

How to Install the LAMP Stack: Linux, Apache, MySQL, and PHP on Ubuntu

30/08/2026
Add A Comment
Leave A Reply Cancel Reply

Latest posts

Cross-Border Payments for Small Businesses: Fees, Exchange Rates, and Fraud Prevention

How to care for your scalp at home for healthier hair and a complete beauty routine

Protecting WordPress Against AI Bots and Unknown Crawlers

PDRN, Peptides, and Biotech Cosmetics: How to Read Advertising Critically

Blog Optimization Checklist for AI Agents and Task-Oriented Search

Advertisement
Chú thích cho quảng cáo

SUBSCRIBE TO UPDATES

Get the latest creative news from SaibABC.Com on web tips, design, and business.

Copyright © 2024. Designed by NujCoom.
  • Home
  • Contact
  • Privacy
  • Tiếng Việt
  • Hmoob

Type above and press Enter to search. Press Esc to cancel.