<?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: InterData</title>
    <description>The latest articles on DEV Community by InterData (@interdata).</description>
    <link>https://dev.to/interdata</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%2F3948915%2F662cf75a-38fe-4c55-900a-58a02165564f.jpg</url>
      <title>DEV Community: InterData</title>
      <link>https://dev.to/interdata</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/interdata"/>
    <language>en</language>
    <item>
      <title>How to Set Up a VPS for the First Time: A Clean Guide</title>
      <dc:creator>InterData</dc:creator>
      <pubDate>Sun, 24 May 2026 10:52:24 +0000</pubDate>
      <link>https://dev.to/interdata/how-to-set-up-a-vps-for-the-first-time-a-clean-guide-5d13</link>
      <guid>https://dev.to/interdata/how-to-set-up-a-vps-for-the-first-time-a-clean-guide-5d13</guid>
      <description>&lt;p&gt;You just bought a shiny new VPS. You got an IP address, a root username, and a random password emailed to you. Logging in as root and dumping your code immediately is the fastest way to get your server hijacked by botnets within 2 hours. Let’s do it the right way instead.&lt;/p&gt;

&lt;p&gt;Here is a step-by-step walkthrough to get your virtual server up, running, and hardened against common security threats.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2vhbd028sbtpgthzwqva.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2vhbd028sbtpgthzwqva.jpg" alt=" " width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Why your default VPS configuration is an accident waiting to happen
&lt;/h2&gt;

&lt;p&gt;Setting up a VPS for the first time requires securing root access, configuring an isolated user, and restricting network ports. Default VPS deployments often expose SSH on port 22 with password logins enabled, making them easy targets for automated brute-force attacks.&lt;/p&gt;

&lt;p&gt;The moment a public IP address goes live, automated botnets begin scanning it. They look specifically for open port 22 (the default SSH port) and attempt to brute-force the &lt;code&gt;root&lt;/code&gt; account with thousands of common passwords. If you leave your default settings active, it is rarely a matter of &lt;em&gt;if&lt;/em&gt; your server gets compromised, but &lt;em&gt;when&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Learning how to manage and secure a server yourself is a massive superpower. Once you understand basic system hygiene, you can host your own databases, web applications, and development sandboxes with peace of mind.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 1: Accessing your VPS via SSH for the first time
&lt;/h2&gt;

&lt;p&gt;To begin, open your computer's terminal (or Command Prompt/PowerShell if you are on Windows) and run the following command to connect as the administrative &lt;code&gt;root&lt;/code&gt; user:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Handling the Host Authenticity Warning
&lt;/h3&gt;

&lt;p&gt;Because this is your first time connecting, you will likely see a warning message like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The authenticity of host '123.456.78.90 (123.456.78.90)' can't be established.
ED25519 key fingerprint is SHA256:...
Are you sure you want to continue connecting (yes/no/[fingerprint])?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not worry—this is normal. It simply means your local computer has never seen this server before and is asking you to confirm its identity. Type &lt;code&gt;yes&lt;/code&gt; and hit Enter. Your system will save this fingerprint to its &lt;code&gt;known_hosts&lt;/code&gt; file to prevent future man-in-the-middle attacks.&lt;/p&gt;

&lt;p&gt;Once connected, enter the temporary root password provided by your hosting provider.&lt;/p&gt;

&lt;h3&gt;
  
  
  Update Packages Instantly
&lt;/h3&gt;

&lt;p&gt;Before installing anything else, you should update the system's package index and upgrade existing software to patch any known security vulnerabilities. For Debian- or Ubuntu-based systems, run:&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;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Pro-Tip:&lt;/strong&gt; Skipping this step on day one is a recipe for dependency hell later on. New software installations often fail or conflict if your system's package repositories are outdated. Always pull the latest package lists first.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Step 2: Creating a sudo user (And why root access is a trap)
&lt;/h2&gt;

&lt;p&gt;Running command-line operations as the root user leaves your server vulnerable to catastrophic typos and malicious exploits. Creating a dedicated non-root user with sudo privileges ensures that any administrative system changes require explicit confirmation and logging.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Create a new user
&lt;/h3&gt;

&lt;p&gt;Let’s create a new, restricted system user. Replace &lt;code&gt;devuser&lt;/code&gt; with whatever username you prefer:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;You will be prompted to enter and confirm a strong password. You can press Enter to skip the additional details like "Full Name" and "Room Number."&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Grant admin privileges
&lt;/h3&gt;

&lt;p&gt;To allow this new user to execute administrative tasks, add them to the &lt;code&gt;sudo&lt;/code&gt; group:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Test your new user session
&lt;/h3&gt;

&lt;p&gt;Before you log out of your root terminal, open a new, separate terminal window on your local machine and try logging in as your 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;ssh devuser@your_server_ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once logged in, verify you have administrative capabilities by running:&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it prompts you for your user password and runs successfully, you have successfully configured a safe administrative account. Keep both terminal windows open for now.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: Hardening SSH access with Public Key Authentication
&lt;/h2&gt;

&lt;p&gt;Using passwords to log into your server is highly vulnerable to brute-force attacks. &lt;strong&gt;SSH key authentication&lt;/strong&gt; uses a pair of cryptographic keys (a public key on the server and a private key on your local machine) to verify your identity, which is virtually impossible to brute-force.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Generate SSH keys locally
&lt;/h3&gt;

&lt;p&gt;On your &lt;strong&gt;local computer's terminal&lt;/strong&gt; (not the VPS), generate an ED25519 key pair (which is faster and more secure than older RSA keys):&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;span class="nt"&gt;-t&lt;/span&gt; ed25519
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Press Enter to save it to the default location. For added security, you can enter a passphrase to protect your private key.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Copy the public key to your VPS
&lt;/h3&gt;

&lt;p&gt;Still on your &lt;strong&gt;local computer&lt;/strong&gt;, copy your newly generated public key to your new server user:&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 devuser@your_server_ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Log back into your VPS using your new user. You should now be logged in automatically without being prompted for your account password.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Edit the SSH port configuration
&lt;/h3&gt;

&lt;p&gt;Now, we need to tell the SSH service to stop accepting password logins and to stop listening on the standard port 22. Open the SSH daemon configuration file using the nano text editor:&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;Scroll through the file and modify the following lines:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Change the port:&lt;/strong&gt; Find &lt;code&gt;#Port 22&lt;/code&gt; (or &lt;code&gt;Port 22&lt;/code&gt;), uncomment it by removing the &lt;code&gt;#&lt;/code&gt;, and change the number to a custom value between 1024 and 65535 (for example, &lt;code&gt;2288&lt;/code&gt;). This simple change avoids 99% of automated port scanners.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disable root login:&lt;/strong&gt; Find &lt;code&gt;PermitRootLogin&lt;/code&gt; and change its value to &lt;code&gt;no&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disable password authentication:&lt;/strong&gt; Find &lt;code&gt;PasswordAuthentication&lt;/code&gt; and set it to &lt;code&gt;no&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Save the changes (press &lt;code&gt;Ctrl + O&lt;/code&gt;, then &lt;code&gt;Enter&lt;/code&gt;) and exit nano (&lt;code&gt;Ctrl + X&lt;/code&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Restart the SSH service
&lt;/h3&gt;

&lt;p&gt;Apply the new settings by restarting the SSH daemon:&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;&lt;em&gt;(Note: On some Linux distributions, the service might be named &lt;code&gt;sshd&lt;/code&gt; instead of &lt;code&gt;ssh&lt;/code&gt;.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do not close your current terminal window yet.&lt;/strong&gt; Open a new terminal window to test your new configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-p&lt;/span&gt; 2288 devuser@your_server_ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you can log in successfully, your SSH hardening is complete.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 4: Building a wall with the UFW firewall
&lt;/h2&gt;

&lt;p&gt;A firewall acts as a barrier, controlling which traffic is allowed into your server. The Uncomplicated Firewall (UFW) is a user-friendly frontend for managing iptables rules on Ubuntu and Debian.&lt;/p&gt;

&lt;p&gt;Before enabling the firewall, you must explicitly allow connections to your new custom SSH port. &lt;strong&gt;If you enable the firewall without opening your custom port first, you will lock yourself out of your server.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run the following commands to configure your 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="c"&gt;# Allow your custom SSH port (Replace 2288 with your chosen port)&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 2288/tcp

&lt;span class="c"&gt;# Allow standard web traffic if you plan to host a website&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow http
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow https

&lt;span class="c"&gt;# Enable the firewall&lt;/span&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;You will see a warning stating that the command may disrupt existing SSH connections. Type &lt;code&gt;y&lt;/code&gt; and press Enter.&lt;/p&gt;

&lt;p&gt;To check the active rules on your firewall, run:&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 verbose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your VPS is now configured, updated, and protected from public threats.&lt;/p&gt;




&lt;h2&gt;
  
  
  FAQ: Quick troubleshooting for first-time VPS admins
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Q: Why can't I connect to my VPS via SSH?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt; The most common reasons you cannot connect to your VPS via SSH are a misconfigured firewall blocking your SSH port, an incorrect username (e.g., logging in as &lt;code&gt;root&lt;/code&gt; after disabling root access), or a mismatch in your local SSH private key file permissions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Q: What are the first things to do on a new VPS?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt; The first five steps to take on a new VPS are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Update system repository packages.&lt;/li&gt;
&lt;li&gt;Create a restricted, non-root user with &lt;code&gt;sudo&lt;/code&gt; permissions.&lt;/li&gt;
&lt;li&gt;Set up SSH key pair authentication.&lt;/li&gt;
&lt;li&gt;Disable root logins and password-based authentication.&lt;/li&gt;
&lt;li&gt;Enable and configure a basic firewall (such as UFW).&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Q: How do I choose the best VPS location?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt; Choose a server location closest to your target audience to reduce latency and improve load times. For users and traffic centered in Southeast Asia, selecting a hosting provider with physical data centers in Vietnam, such as &lt;strong&gt;InterData&lt;/strong&gt;, ensures low ping rates, local compliance, and high throughput compared to US-based servers.&lt;/p&gt;




&lt;h3&gt;
  
  
  Need a reliable sandbox?
&lt;/h3&gt;

&lt;p&gt;If you are looking for a high-performance sandbox to deploy your applications, check out &lt;a href="https://interdata.vn/thue-vps/" rel="noopener noreferrer"&gt;InterData VPS Hosting&lt;/a&gt;. We offer pure NVMe enterprise storage, 10Gbps network connectivity, and localized customer support that actually speaks dev-language when things go sideways.&lt;/p&gt;

</description>
      <category>vps</category>
      <category>server</category>
    </item>
  </channel>
</rss>
