<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SSH &#8211; Aveshost Blog</title>
	<atom:link href="https://blog.aveshost.com/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.aveshost.com</link>
	<description>Your Blueprint for Online Success</description>
	<lastBuildDate>Sat, 21 Nov 2026 22:14:03 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.5</generator>

<image>
	<url>https://blog.aveshost.com/wp-content/uploads/2026/01/logo-150x150.png</url>
	<title>SSH &#8211; Aveshost Blog</title>
	<link>https://blog.aveshost.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Secure VPS Access with Tailscale Without Opening Public Admin Ports</title>
		<link>https://blog.aveshost.com/secure-vps-access-tailscale-without-public-ports/</link>
					<comments>https://blog.aveshost.com/secure-vps-access-tailscale-without-public-ports/#respond</comments>
		
		<dc:creator><![CDATA[James Wilson]]></dc:creator>
		<pubDate>Sat, 21 Nov 2026 20:55:19 +0000</pubDate>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Tailscale]]></category>
		<category><![CDATA[Ubuntu VPS]]></category>
		<category><![CDATA[UFW Firewall]]></category>
		<category><![CDATA[VPS Security]]></category>
		<guid isPermaLink="false">https://blog.aveshost.com/?p=6131</guid>

					<description><![CDATA[A step-by-step guide to securing Ubuntu VPS access with Tailscale so SSH, databases, and admin dashboards stay completely unreachable from the public internet while remaining fast for authorized admins.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Learning how to <strong>secure VPS access with Tailscale</strong> eliminates one of the biggest attack surfaces on any Linux server: publicly exposed SSH and admin ports. The moment a cloud VPS comes online, automated scanners probe port <code>22</code>, database ports, and container dashboards around the clock.</p>



<p class="wp-block-paragraph">By placing your server on a private WireGuard-encrypted Tailscale mesh network and locking down UFW to accept admin traffic only on the <code>tailscale0</code> interface, your public IP exposes nothing except ports <code>80</code> and <code>443</code> for live web traffic.</p>



<p class="wp-block-paragraph">Whether you run <a href="https://www.aveshost.com/self-managed-vps-hosting" rel="noopener">self-managed VPS hosting</a> or <a href="https://www.aveshost.com/fully-managed-vps-hosting" rel="noopener">fully managed VPS hosting</a> with Aveshost, this guide walks through installing Tailscale, locking down UFW without locking yourself out, enabling identity-based Tailscale SSH, and enforcing tag ACLs.</p>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><div><div><a href="#why-closing-public-admin-ports-matters">Why Closing Public Admin Ports Matters on a VPS</a></div><div><a href="#step-1-install-tailscale-on-ubuntu-vps">Step 1: Install and Authenticate Tailscale on Your Ubuntu VPS</a></div><div><a href="#step-2-lock-down-ufw-to-tailscale0">Step 2: Configure UFW to Allow Admin Traffic Only on tailscale0</a></div><div><a href="#step-3-enable-tailscale-ssh-and-tag-acls">Step 3: Enable Tailscale SSH and Tag-Based ACLs</a></div><div><a href="#vps-emergency-console-and-maintenance">Emergency Console Recovery and Ongoing Maintenance</a></div><div><a href="#faq">Frequently asked questions</a></div></div></nav></div>



<h2 id="why-closing-public-admin-ports-matters" class="wp-block-heading">Why Closing Public Admin Ports Matters on a VPS</h2>



<p class="wp-block-paragraph"><strong>What is Tailscale?</strong> If you are new to private networking, Tailscale is a modern, zero-configuration mesh VPN built on the fast <strong>WireGuard</strong> protocol. Unlike traditional VPNs that force you to manage complex server certificates or route all traffic through a single bottleneck, Tailscale creates an encrypted peer-to-peer private network (called a <em>tailnet</em>) between your laptops, phones, and VPS instances. Every device you authorize receives a private <code>100.x.y.z</code> IP address, letting your devices talk directly over an encrypted tunnel even behind home routers or strict firewalls.</p>



<p class="wp-block-paragraph">Even with SSH key authentication and Fail2Ban enabled, leaving port <code>22</code>, PostgreSQL (<code>5432</code>), MySQL (<code>3306</code>), or web admin panels open on your public IP forces your server to process constant brute-force traffic and zero-day vulnerability scans.</p>



<p class="wp-block-paragraph">With Tailscale, your VPS joins a private overlay network in the <code>100.64.0.0/10</code> range (<code>100.x.y.z</code>). Public scanners hitting your server&#8217;s public IPv4 or IPv6 address see a closed firewall on every administrative port, while your authenticated devices reach SSH and internal dashboards directly over WireGuard.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Service / Port</th><th>Traditional Public VPS</th><th>Tailscale + UFW Lock-Down</th></tr></thead><tbody><tr><td>SSH (Port 22)</td><td>Exposed to 0.0.0.0/0; constant brute-force bots</td><td>Allowed only on tailscale0 (100.x.y.z)</td></tr><tr><td>Databases (3306 / 5432)</td><td>Risky if bound to public IP or Docker 0.0.0.0</td><td>Bound to 127.0.0.1 or tailscale0 only</td></tr><tr><td>Admin UIs (Portainer / Uptime Kuma)</td><td>Requires public reverse proxy + auth hardening</td><td>Accessible privately over WireGuard tailnet</td></tr><tr><td>Public Websites (80 / 443)</td><td>Open to visitors via eth0</td><td>Open to visitors via eth0 (unchanged)</td></tr></tbody></table></figure>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1536" height="1024" src="https://blog.aveshost.com/wp-content/uploads/2026/11/tailscale-vps-ufw-architecture.webp" alt="Architecture diagram showing public web ports 80 and 443 separated from private tailscale0 SSH and admin traffic" class="wp-image-6128" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/tailscale-vps-ufw-architecture.webp 1536w, https://blog.aveshost.com/wp-content/uploads/2026/11/tailscale-vps-ufw-architecture-300x200.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/tailscale-vps-ufw-architecture-1024x683.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/tailscale-vps-ufw-architecture-768x512.webp 768w" sizes="(max-width: 1536px) 100vw, 1536px" /></figure>



<h2 id="step-1-install-tailscale-on-ubuntu-vps" class="wp-block-heading">Step 1: Install and Authenticate Tailscale on Your Ubuntu VPS</h2>



<p class="wp-block-paragraph">Connect to your VPS over SSH one last time via its public IP, then install the official Tailscale client using the repository script documented in the <a href="https://tailscale.com/kb/1031/install-linux" rel="noopener">Tailscale Linux installation guide</a>.</p>



<p class="wp-block-paragraph">Run <code>sudo tailscale up</code> (or include <code>--ssh</code> to enable identity-based Tailscale SSH right away) and open the printed login URL in your browser to authorize the VPS in your tailnet. Once connected, run <code>tailscale ip -4</code> to note your server&#8217;s private <code>100.x.y.z</code> address.</p>



<p class="wp-block-paragraph"><strong>Critical safety rule:</strong> Before touching any firewall rules, open a brand-new terminal window on your laptop (with Tailscale running locally) and verify you can log in via <code>ssh user@100.x.y.z</code>.</p>



<pre class="wp-block-code"><code># 1. Install Tailscale on Ubuntu VPS
curl -fsSL https://tailscale.com/install.sh | sh

# 2. Authenticate and check your private 100.x IP
sudo tailscale up --ssh
tailscale ip -4</code></pre>



<h2 id="step-2-lock-down-ufw-to-tailscale0" class="wp-block-heading">Step 2: Configure UFW to Allow Admin Traffic Only on tailscale0</h2>



<p class="wp-block-paragraph">Once you confirm your SSH session works over the <code>100.x.y.z</code> Tailscale IP, lock down UFW following the <a href="https://tailscale.com/kb/1077/secure-server-ubuntu" rel="noopener">Tailscale Ubuntu firewall guide</a>. Set default policies to deny all incoming traffic, allow incoming traffic on the <code>tailscale0</code> interface, and keep only public HTTP/HTTPS ports open if the VPS hosts websites.</p>



<p class="wp-block-paragraph">If you previously ran <code>ufw allow 22</code> or <code>ufw allow OpenSSH</code>, inspect <code>sudo ufw status numbered</code> and delete those public port <code>22</code> rules so SSH is no longer reachable from the public internet.</p>



<p class="wp-block-paragraph">Remember: if you run Docker containers on the same VPS, Docker writes its own <code>iptables</code> rules that can bypass UFW when ports are bound to <code>0.0.0.0</code>. Always bind internal admin UIs (such as Portainer, Dokploy, Coolify, or <a href="https://blog.aveshost.com/public-website-status-page-with-uptime-kuma/">Uptime Kuma</a>) to <code>127.0.0.1</code> or your Tailscale IP—see our guide on <a href="https://blog.aveshost.com/docker-ufw-unexpected-ports/">stopping Docker from exposing unexpected ports with UFW</a>.</p>



<pre class="wp-block-code"><code># Test SSH over Tailscale FIRST: ssh youruser@100.x.y.z
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow in on tailscale0
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

# Remove public port 22 rules if present, then enable
sudo ufw status numbered
sudo ufw enable &amp;&amp; sudo ufw reload</code></pre>



<h2 id="step-3-enable-tailscale-ssh-and-tag-acls" class="wp-block-heading">Step 3: Enable Tailscale SSH and Tag-Based ACLs</h2>



<p class="wp-block-paragraph">To eliminate static SSH key sprawl altogether, enable <strong>Tailscale SSH</strong> with <code>sudo tailscale set --ssh</code>. Tailscale intercepts SSH connections arriving on <code>tailscale0</code> and authenticates users through your identity provider (Google, GitHub, Microsoft, or Okta) and WireGuard node keys.</p>



<p class="wp-block-paragraph">For teams managing multiple servers, assign a server tag such as <code>tag:vps</code> and restrict access in your Tailscale Admin Console <strong>Access Controls</strong> policy so only devices tagged <code>tag:admin-devices</code> can reach port <code>22</code> or internal admin ports. Tailscale ACLs default to deny, meaning any port not explicitly listed in an <code>accept</code> block stays blocked even inside your tailnet.</p>



<p class="wp-block-paragraph">You can also combine Tailscale with private remote desktop tools—for instance, binding self-hosted management dashboards privately alongside our <a href="https://blog.aveshost.com/self-host-rustdesk-ubuntu-vps/">RustDesk Ubuntu VPS setup</a> or securing API backends from our <a href="https://blog.aveshost.com/deploy-fastapi-ubuntu-vps/">Ubuntu FastAPI deployment guide</a>.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1536" height="1024" src="https://blog.aveshost.com/wp-content/uploads/2026/11/tailscale-vps-hardening-checklist.webp" alt="Six-step checklist for securing Ubuntu VPS access with Tailscale and UFW without public admin ports" class="wp-image-6129" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/tailscale-vps-hardening-checklist.webp 1536w, https://blog.aveshost.com/wp-content/uploads/2026/11/tailscale-vps-hardening-checklist-300x200.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/tailscale-vps-hardening-checklist-1024x683.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/tailscale-vps-hardening-checklist-768x512.webp 768w" sizes="(max-width: 1536px) 100vw, 1536px" /></figure>



<pre class="wp-block-code"><code>{
  "tagOwners": {
    "tag:vps": &#91;"autogroup:admin"],
    "tag:admin-devices": &#91;"autogroup:admin"]
  },
  "acls": &#91;
    {
      "action": "accept",
      "src": &#91;"tag:admin-devices"],
      "dst": &#91;"tag:vps:22", "tag:vps:8080", "tag:vps:443"]
    }
  ],
  "ssh": &#91;
    {
      "action": "accept",
      "src": &#91;"tag:admin-devices"],
      "dst": &#91;"tag:vps"],
      "users": &#91;"ubuntu", "root"]
    }
  ]
}</code></pre>



<h2 id="vps-emergency-console-and-maintenance" class="wp-block-heading">Emergency Console Recovery and Ongoing Maintenance</h2>



<p class="wp-block-paragraph">Closing public port <code>22</code> drastically reduces automated attack noise, but always verify you have a working out-of-band recovery path. On <a href="https://www.aveshost.com/" rel="noopener">Aveshost</a> self-managed VPS hosting and fully managed VPS hosting, your client area provides a browser-based VNC/serial console in case <code>tailscaled</code> ever stops during an OS upgrade.</p>



<p class="wp-block-paragraph">Keep <code>tailscale</code> updated alongside regular <code>apt upgrade</code> security patches so WireGuard keys, DERP relay connections, and kernel networking stay healthy.</p>



<h2 id="faq" class="wp-block-heading">Frequently asked questions</h2>


<div id="rank-math-faq" class="rank-math-block">
<div class="rank-math-list ">
<div id="faq-question-200d6bbb1fc1423b97453a7e2d3b2fd1" class="rank-math-list-item">
<h3 class="rank-math-question ">Will I lock myself out of my VPS if I close port 22 in UFW?</h3>
<div class="rank-math-answer ">

<p>Not if you install Tailscale first, verify you can SSH into your VPS via its 100.x.y.z Tailscale IP, and add sudo ufw allow in on tailscale0 before deleting public port 22 rules. You can also use your VPS provider&#8217;s web VNC console as an emergency fallback.</p>

</div>
</div>
<div id="faq-question-24bde45712644863b0ccc4f3a1499581" class="rank-math-list-item">
<h3 class="rank-math-question ">Does Tailscale slow down public website traffic on port 80 or 443?</h3>
<div class="rank-math-answer ">

<p>No. Public visitors continue connecting directly to Nginx, Apache, or Caddy over your VPS&#8217;s normal public network interface (eth0). Only administrative traffic on 100.x.y.z travels through the tailscale0 WireGuard tunnel.</p>

</div>
</div>
<div id="faq-question-908df9de85c149279632594aa8cf3224" class="rank-math-list-item">
<h3 class="rank-math-question ">Why does Docker still expose admin ports even after enabling UFW?</h3>
<div class="rank-math-answer ">

<p>By default, Docker publishes -p 8080:8080 on 0.0.0.0 and inserts iptables rules before UFW&#8217;s chains. To keep admin dashboards private to Tailscale, bind them to 127.0.0.1:8080:8080 or your 100.x.y.z:8080:8080 Tailscale IP.</p>

</div>
</div>
<div id="faq-question-a11303e713d14f1eba93686c97a85ad0" class="rank-math-list-item">
<h3 class="rank-math-question ">What is the difference between regular SSH over Tailscale and Tailscale SSH?</h3>
<div class="rank-math-answer ">

<p>Regular SSH over Tailscale still uses your server&#8217;s sshd daemon and ~/.ssh/authorized_keys file, just routed privately over tailscale0. Tailscale SSH (tailscale set &#8211;ssh) replaces static SSH keys with identity-provider authentication and tailnet ACL rules.</p>

</div>
</div>
<div id="faq-question-724ea356925340febff196fda5c1b209" class="rank-math-list-item">
<h3 class="rank-math-question ">Is Tailscale free for securing a personal or small-team VPS?</h3>
<div class="rank-math-answer ">

<p>Yes. Tailscale&#8217;s Personal plan supports up to 3 users and 100 devices for free, which easily covers securing personal or small-team VPS instances without public admin ports.</p>

</div>
</div>
</div>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://blog.aveshost.com/secure-vps-access-tailscale-without-public-ports/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
