<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sovrab Roy</title>
    <description>The latest articles on DEV Community by Sovrab Roy (@sovrab).</description>
    <link>https://dev.to/sovrab</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3916743%2F1bd6fb46-6cc5-46a1-9687-f73cde40dfce.png</url>
      <title>DEV Community: Sovrab Roy</title>
      <link>https://dev.to/sovrab</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sovrab"/>
    <language>en</language>
    <item>
      <title>How to Secure an Ubuntu Linux Server for Production</title>
      <dc:creator>Sovrab Roy</dc:creator>
      <pubDate>Fri, 08 May 2026 21:43:11 +0000</pubDate>
      <link>https://dev.to/sovrab/how-to-secure-an-ubuntu-linux-server-for-production-1j3p</link>
      <guid>https://dev.to/sovrab/how-to-secure-an-ubuntu-linux-server-for-production-1j3p</guid>
      <description>&lt;h1&gt;
  
  
  How to Secure an Ubuntu Linux Server for Production
&lt;/h1&gt;

&lt;p&gt;Securing a production Linux server is one of the most important responsibilities of a system administrator. A poorly configured server can become an easy target for brute-force attacks, malware, unauthorized access, and service disruption.&lt;/p&gt;

&lt;p&gt;In this guide, I’ll share essential steps to harden and secure an Ubuntu server for production environments.&lt;/p&gt;




&lt;h1&gt;
  
  
  1. Update Your Server Regularly
&lt;/h1&gt;

&lt;p&gt;Always keep your system packages updated to patch security vulnerabilities.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should also remove unused packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt autoremove &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  2. Create a Non-Root User
&lt;/h1&gt;

&lt;p&gt;Avoid using the root user directly for daily administration tasks.&lt;/p&gt;

&lt;p&gt;Create a new user:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;adduser adminuser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the user to the sudo group:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;adminuser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  3. Disable Root SSH Login
&lt;/h1&gt;

&lt;p&gt;Root login through SSH is a major security risk.&lt;/p&gt;

&lt;p&gt;Edit the SSH configuration file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/ssh/sshd_config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PermitRootLogin yes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change it to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PermitRootLogin no
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart SSH:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  4. Change the Default SSH Port
&lt;/h1&gt;

&lt;p&gt;Changing the default SSH port helps reduce automated brute-force attacks.&lt;/p&gt;

&lt;p&gt;Inside the SSH config file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Port 2222
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart SSH:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember to allow the new port in your firewall.&lt;/p&gt;




&lt;h1&gt;
  
  
  5. Configure UFW Firewall
&lt;/h1&gt;

&lt;p&gt;Ubuntu comes with UFW (Uncomplicated Firewall).&lt;/p&gt;

&lt;p&gt;Allow required services:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 2222/tcp
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 80/tcp
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 443/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable the firewall:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw &lt;span class="nb"&gt;enable&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  6. Install Fail2Ban
&lt;/h1&gt;

&lt;p&gt;Fail2Ban blocks repeated failed login attempts automatically.&lt;/p&gt;

&lt;p&gt;Install it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;fail2ban &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable and start the service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;fail2ban
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start fail2ban
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;fail2ban-client status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  7. Use SSH Key Authentication
&lt;/h1&gt;

&lt;p&gt;SSH keys are much safer than passwords.&lt;/p&gt;

&lt;p&gt;Generate SSH keys on your local machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the public key to the server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-copy-id user@server-ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then disable password authentication:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PasswordAuthentication no
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart SSH afterward.&lt;/p&gt;




&lt;h1&gt;
  
  
  8. Secure Docker Containers
&lt;/h1&gt;

&lt;p&gt;If you use Docker in production:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Avoid running containers as root&lt;/li&gt;
&lt;li&gt;Keep images updated&lt;/li&gt;
&lt;li&gt;Use trusted images only&lt;/li&gt;
&lt;li&gt;Limit exposed ports&lt;/li&gt;
&lt;li&gt;Scan images for vulnerabilities&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Update Docker regularly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;docker-ce docker-ce-cli containerd.io
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  9. Enable Automatic Security Updates
&lt;/h1&gt;

&lt;p&gt;Install unattended upgrades:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;unattended-upgrades &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable automatic security updates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;dpkg-reconfigure unattended-upgrades
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  10. Monitor Logs and System Activity
&lt;/h1&gt;

&lt;p&gt;Regular monitoring helps detect suspicious activity early.&lt;/p&gt;

&lt;p&gt;Useful commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;journalctl &lt;span class="nt"&gt;-xe&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo tail&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; /var/log/auth.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also use tools like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prometheus&lt;/li&gt;
&lt;li&gt;Grafana&lt;/li&gt;
&lt;li&gt;Netdata&lt;/li&gt;
&lt;li&gt;Uptime Kuma&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  11. Backup Your Server
&lt;/h1&gt;

&lt;p&gt;Always maintain secure backups.&lt;/p&gt;

&lt;p&gt;Recommended practices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Daily automated backups&lt;/li&gt;
&lt;li&gt;Offsite storage&lt;/li&gt;
&lt;li&gt;Database dumps&lt;/li&gt;
&lt;li&gt;Backup verification&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;rsync&lt;/li&gt;
&lt;li&gt;BorgBackup&lt;/li&gt;
&lt;li&gt;Restic&lt;/li&gt;
&lt;li&gt;Rclone&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Server security is not a one-time setup. It’s an ongoing process that requires continuous monitoring, updates, and optimization.&lt;/p&gt;

&lt;p&gt;A properly secured Ubuntu server reduces risks, improves reliability, and helps maintain stable production environments.&lt;/p&gt;

&lt;p&gt;If you’re managing Linux servers in production, implementing these security practices is essential.&lt;/p&gt;




&lt;h1&gt;
  
  
  linux #ubuntu #security #devops
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>linux</category>
      <category>security</category>
      <category>devops</category>
      <category>ubuntu</category>
    </item>
    <item>
      <title>Useful Linux Commands Every System Administrator Should Know</title>
      <dc:creator>Sovrab Roy</dc:creator>
      <pubDate>Thu, 07 May 2026 21:41:24 +0000</pubDate>
      <link>https://dev.to/sovrab/useful-linux-commands-every-system-administrator-should-know-3141</link>
      <guid>https://dev.to/sovrab/useful-linux-commands-every-system-administrator-should-know-3141</guid>
      <description>&lt;h1&gt;
  
  
  Useful Linux Commands Every System Administrator Should Know
&lt;/h1&gt;

&lt;p&gt;Linux system administration becomes much easier when you know the right commands for monitoring, troubleshooting, and managing servers efficiently.&lt;/p&gt;

&lt;p&gt;In this article, I’ll share some useful Linux commands that I regularly use while managing production servers and cloud infrastructure environments.&lt;/p&gt;




&lt;h1&gt;
  
  
  1. Check System Uptime
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;uptime&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Displays:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;server uptime&lt;/li&gt;
&lt;li&gt;current load average&lt;/li&gt;
&lt;li&gt;active users&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Useful for quick server health checks.&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Monitor Running Processes
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;htop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;top
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Helps identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;high CPU usage&lt;/li&gt;
&lt;li&gt;memory consumption&lt;/li&gt;
&lt;li&gt;overloaded processes&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  3. Check Disk Usage
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Displays disk space usage in human-readable format.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Analyze Directory Sizes
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Very useful when troubleshooting storage problems.&lt;/p&gt;




&lt;h1&gt;
  
  
  5. Check Memory Usage
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;free &lt;span class="nt"&gt;-m&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Shows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RAM usage&lt;/li&gt;
&lt;li&gt;swap usage&lt;/li&gt;
&lt;li&gt;available memory&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  6. View Running Services
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl list-units &lt;span class="nt"&gt;--type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Manage services:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart nginx
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  7. Monitor Network Connections
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ss &lt;span class="nt"&gt;-tulpn&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful for checking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;open ports&lt;/li&gt;
&lt;li&gt;active services&lt;/li&gt;
&lt;li&gt;listening processes&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  8. Search Logs Efficiently
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; /var/log/syslog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl &lt;span class="nt"&gt;-xe&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Essential for troubleshooting server issues.&lt;/p&gt;




&lt;h1&gt;
  
  
  9. Secure File Permissions
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod &lt;/span&gt;644 file.txt
&lt;span class="nb"&gt;chmod &lt;/span&gt;755 script.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Understanding Linux permissions is critical for server security.&lt;/p&gt;




&lt;h1&gt;
  
  
  10. Check Server IP Address
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;hostname&lt;/span&gt; &lt;span class="nt"&gt;-I&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  11. Test Server Connectivity
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ping google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check routing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;traceroute google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  12. Monitor Real-Time Resource Usage
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vmstat 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Provides live system performance statistics.&lt;/p&gt;




&lt;h1&gt;
  
  
  13. Docker Management Commands
&lt;/h1&gt;

&lt;p&gt;List containers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker ps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;View logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker logs container_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker restart container_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  14. Secure SSH Access
&lt;/h1&gt;

&lt;p&gt;Restart SSH:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check SSH port:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ss &lt;span class="nt"&gt;-tulpn&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Linux commands are powerful tools for server administration, monitoring, troubleshooting, and infrastructure management.&lt;/p&gt;

&lt;p&gt;A strong understanding of Linux fundamentals helps system administrators maintain stable, secure, and high-performance production environments.&lt;/p&gt;

&lt;p&gt;I regularly work with Linux servers, Docker, cPanel/WHM, hosting technologies, and cloud infrastructure optimization.&lt;/p&gt;

&lt;p&gt;🌐 Portfolio:&lt;br&gt;
&lt;a href="https://sovrabroy.online" rel="noopener noreferrer"&gt;https://sovrabroy.online&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  linux #devops #bash #serveradministration
&lt;/h1&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>security</category>
      <category>bash</category>
    </item>
    <item>
      <title>Essential Linux Server Hardening Steps for Production Environments</title>
      <dc:creator>Sovrab Roy</dc:creator>
      <pubDate>Wed, 06 May 2026 22:07:26 +0000</pubDate>
      <link>https://dev.to/sovrab/essential-linux-server-hardening-steps-for-production-environments-3gm1</link>
      <guid>https://dev.to/sovrab/essential-linux-server-hardening-steps-for-production-environments-3gm1</guid>
      <description>&lt;h1&gt;
  
  
  Essential Linux Server Hardening Steps for Production Environments
&lt;/h1&gt;

&lt;p&gt;Securing a Linux server is one of the most important responsibilities of a system administrator. A poorly configured server can become vulnerable to brute-force attacks, malware, privilege escalation, and unauthorized access.&lt;/p&gt;

&lt;p&gt;In this article, I will share some essential Linux server hardening steps that I usually apply after deploying a fresh Ubuntu or Debian server for production use.&lt;/p&gt;




&lt;h1&gt;
  
  
  1. Update System Packages
&lt;/h1&gt;

&lt;p&gt;The first thing I do is update all installed packages and security patches.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keeping packages updated reduces security vulnerabilities and improves server stability.&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Create a Non-Root Sudo User
&lt;/h1&gt;

&lt;p&gt;Using the root account directly is risky. Instead, create a separate sudo user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;adduser sovrab
usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;sovrab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This improves accountability and reduces direct root exposure.&lt;/p&gt;




&lt;h1&gt;
  
  
  3. Disable Root SSH Login
&lt;/h1&gt;

&lt;p&gt;Root login through SSH should be disabled to prevent brute-force attacks.&lt;/p&gt;

&lt;p&gt;Edit the SSH configuration file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/ssh/sshd_config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;PermitRootLogin &lt;span class="nb"&gt;yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change it to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;PermitRootLogin no
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart SSH service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  4. Change Default SSH Port
&lt;/h1&gt;

&lt;p&gt;Changing the default SSH port from 22 to another custom port helps reduce automated attack attempts.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Port 2222
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not forget to allow the new port through the firewall.&lt;/p&gt;




&lt;h1&gt;
  
  
  5. Configure UFW Firewall
&lt;/h1&gt;

&lt;p&gt;Ubuntu ships with UFW (Uncomplicated Firewall), which is easy to configure.&lt;/p&gt;

&lt;p&gt;Allow SSH port:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 2222/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable firewall:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw &lt;span class="nb"&gt;enable&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  6. Install Fail2Ban
&lt;/h1&gt;

&lt;p&gt;Fail2Ban protects servers from repeated failed login attempts.&lt;/p&gt;

&lt;p&gt;Install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;fail2ban &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable and start:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;fail2ban
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start fail2ban
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;fail2ban-client status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  7. Configure Automatic Security Updates
&lt;/h1&gt;

&lt;p&gt;Automatic security updates help patch vulnerabilities quickly.&lt;/p&gt;

&lt;p&gt;Install unattended upgrades:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;unattended-upgrades
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;dpkg-reconfigure unattended-upgrades
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  8. Disable Unused Services
&lt;/h1&gt;

&lt;p&gt;Unused services increase attack surfaces.&lt;/p&gt;

&lt;p&gt;Check running services:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl list-units &lt;span class="nt"&gt;--type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Disable unnecessary services:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl disable service-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  9. Monitor Server Resources
&lt;/h1&gt;

&lt;p&gt;Resource monitoring helps detect unusual activity and performance bottlenecks.&lt;/p&gt;

&lt;p&gt;Useful commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;htop
&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;
free &lt;span class="nt"&gt;-m&lt;/span&gt;
&lt;span class="nb"&gt;uptime&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  10. Secure Shared Hosting Environments
&lt;/h1&gt;

&lt;p&gt;For cPanel or shared hosting servers, additional security measures are recommended:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configure CSF firewall&lt;/li&gt;
&lt;li&gt;Enable ModSecurity&lt;/li&gt;
&lt;li&gt;Harden PHP functions&lt;/li&gt;
&lt;li&gt;Use CloudLinux isolation&lt;/li&gt;
&lt;li&gt;Enable ImunifyAV or Imunify360&lt;/li&gt;
&lt;li&gt;Configure secure backups&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  11. Backup Strategy
&lt;/h1&gt;

&lt;p&gt;Backups are critical for disaster recovery.&lt;/p&gt;

&lt;p&gt;Important backup locations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Website files&lt;/li&gt;
&lt;li&gt;MySQL databases&lt;/li&gt;
&lt;li&gt;Configuration files&lt;/li&gt;
&lt;li&gt;DNS zones&lt;/li&gt;
&lt;li&gt;Email accounts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I usually automate backups using shell scripts and remote storage solutions.&lt;/p&gt;




&lt;h1&gt;
  
  
  12. Docker Security Basics
&lt;/h1&gt;

&lt;p&gt;If Docker is installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Avoid running containers as root&lt;/li&gt;
&lt;li&gt;Use trusted images only&lt;/li&gt;
&lt;li&gt;Keep images updated&lt;/li&gt;
&lt;li&gt;Limit container privileges&lt;/li&gt;
&lt;li&gt;Monitor exposed ports&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check containers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker ps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Linux server hardening is not a one-time task. Security requires continuous monitoring, patching, auditing, and optimization.&lt;/p&gt;

&lt;p&gt;A properly secured Linux server improves reliability, uptime, and infrastructure stability while reducing security risks.&lt;/p&gt;

&lt;p&gt;As a Linux System Administrator and Server Engineer, I regularly work with Linux servers, cloud infrastructure, Docker, cPanel, hosting technologies, and production environment optimization.&lt;/p&gt;

&lt;p&gt;🌐 Portfolio:&lt;br&gt;
&lt;a href="https://sovrabroy.online" rel="noopener noreferrer"&gt;https://sovrabroy.online&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  linux #devops #cloud #docker #serveradministration
&lt;/h1&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>cloud</category>
      <category>git</category>
    </item>
    <item>
      <title>Hello DEV Community 👋

I'm Sovrab Roy, a Linux System Administrator &amp; Server Engineer from Bangladesh.

I work with Linux servers, cloud infrastructure, cPanel, Docker, hosting technologies, and server optimization.

Looking forward to sharing technical</title>
      <dc:creator>Sovrab Roy</dc:creator>
      <pubDate>Wed, 06 May 2026 22:02:07 +0000</pubDate>
      <link>https://dev.to/sovrab/hello-dev-community-im-sovrab-roy-a-linux-system-administrator-server-engineer-from-1l7e</link>
      <guid>https://dev.to/sovrab/hello-dev-community-im-sovrab-roy-a-linux-system-administrator-server-engineer-from-1l7e</guid>
      <description></description>
      <category>community</category>
      <category>docker</category>
      <category>infrastructure</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
