A New Collection of Thoughtful Learning Apps — Now Available on iOS & Android

Image
I’m excited to share a set of mobile apps I’ve recently completed and published on both the Google Play Store and the Apple App Store. These apps are designed with a simple goal in mind: to make meaningful, structured content more accessible, whether you’re studying theology or improving your English vocabulary. 📱 Now Available on Both Platforms All apps are live and available for download: Google Play Developer Page: https://play.google.com/store/apps/dev?id=5835943159853189043 Apple App Store Developer Page: https://apps.apple.com/ca/developer/q-z-l-corp/id1888794100 📖 Theology & Confession Study Apps For those interested in Reformed theology and classical Christian teachings, I’ve developed a series of apps that present foundational texts in a clean, focused reading format: The Belgic Confession Canons of Dort Heidelberg Catechism Westminster Shorter Catechism Each app is designed to provide a distraction-free experience, making it easier to read, reflect, and revisit these im...

How to SSH into an Oracle Cloud VPS from Your Mac Using Cloudflare Tunnel

 

How to SSH into an Oracle Cloud VPS from Your Mac Using Cloudflare Tunnel

In the previous tutorials, we configured a free domain with Cloudflare, connected it to an Oracle Cloud VPS, and published a website using Cloudflare Tunnel.

Now let's take it one step further.

Wouldn't it be convenient to SSH directly into your Oracle Cloud VPS from your Mac, without opening port 22 to the public Internet or launching Oracle Cloud Shell every time?

That's exactly what we'll accomplish in this tutorial.

1. What We Want to Achieve

Our goal is to run this command directly from the Mac terminal:

ssh oci

And connect to our Oracle Cloud VPS.

Our VPS has:

  • Oracle Linux 9

  • ARM64 architecture

  • 2 OCPUs and 12 GB RAM

  • A private IP address only

  • No public IP address

We will reuse the Cloudflare Tunnel configured in the previous tutorial.

2. Understand the Architecture

The connection will look like this:

Mac
 |
 | ssh oci
 |
 | SSH + cloudflared
 v
Cloudflare Access
 |
 v
Cloudflare Network
 |
 v
Cloudflare Tunnel
 |
 v
OCI VPS (private network)
 |
 v
sshd (localhost:22)

There are three separate components involved:

  1. Cloudflare Tunnel provides a secure outbound connection from our VPS to Cloudflare.

  2. Cloudflare Access optionally authenticates users before allowing access to the SSH application.

  3. SSH keys authenticate the Linux user on the VPS.

The important point is that our VPS does not need a public IP address, and we do not need to expose port 22 publicly.

3. Configure SSH on the Oracle Cloud VPS

First, connect to your VPS using your existing method, such as Oracle Cloud Shell.

Check whether the SSH service is running:

sudo systemctl status sshd

If it isn't running, enable and start it:

sudo systemctl enable --now sshd

Check that SSH is listening on port 22:

sudo ss -lntp | grep ':22'

Make sure the service is accessible locally through port 22.

4. Add an SSH Application to Cloudflare Tunnel



Open the Cloudflare dashboard.

Navigate to:

Zero Trust → Networks → Connectors → Cloudflare Tunnels

Select the existing Tunnel that your OCI VPS is already using.

Open its published application routes and add a new route.

Configure it as follows:

SettingValue
Subdomainssh
Domainqzlapp.us.ci
PathLeave empty
Service TypeSSH
Service URLssh://localhost:22

The resulting hostname is:

ssh.qzlapp.us.ci

Note: Depending on the Cloudflare dashboard version, SSH might not appear as a separate service type. The Service URL field accepts the ssh:// scheme directly.

Save the route.

Cloudflare will create the corresponding DNS record pointing to your Tunnel.

You do not need to create another Tunnel. Multiple applications can share the same Tunnel.

5. (Recommended) Configure Cloudflare Access

For additional protection, create a self-hosted application in Cloudflare Access.

Use:

ssh.qzlapp.us.ci

Then create an Allow policy for your own email address.

This ensures that only authorized users can access the SSH application through Cloudflare Access.

Remember that Cloudflare Access and Linux SSH authentication are separate layers.

6. Install cloudflared on Your Mac

Now switch to your Mac terminal.

If you use Homebrew, install the Cloudflare client:

brew install cloudflared

Verify the installation:

cloudflared --version

Check its location:

which cloudflared

On an Apple Silicon Mac, the usual result is:

/opt/homebrew/bin/cloudflared

7. Configure Your SSH Key

Make sure you have your private SSH key available on your Mac.

For example:

~/.ssh/ssh-key-2026-11-05.key

SSH requires private keys to have restrictive permissions:

chmod 400 ~/.ssh/ssh-key-2026-11-05.key

If you haven't configured SSH public-key authentication on your VPS yet, add the corresponding public key to the Linux user's ~/.ssh/authorized_keys.

8. Configure SSH ProxyCommand

This is the most important step.

Open your SSH configuration file on your Mac:

nano ~/.ssh/config

Add:

Host oci
    HostName ssh.qzlapp.us.ci
    User opc
    ProxyCommand /opt/homebrew/bin/cloudflared access ssh --hostname %h
    IdentityFile ~/.ssh/ssh-key-2026-11-05.key
    IdentitiesOnly yes
    ServerAliveInterval 30

Let's understand the important line:

ProxyCommand /opt/homebrew/bin/cloudflared access ssh --hostname %h

Normally, SSH attempts to establish a direct TCP connection to the SSH server.

However, our VPS does not have a public IP address.

ProxyCommand tells SSH to launch an external program to establish the connection instead.

Here is what each part means:

PartExplanation
ProxyCommandUse an external program as the connection transport
/opt/homebrew/bin/cloudflaredThe Cloudflare client installed on your Mac
access sshStart the Cloudflare SSH connection process
--hostname %hPass the SSH hostname to cloudflared

The %h is an SSH configuration placeholder. SSH replaces it with the value of HostName.

In our example, it becomes:

cloudflared access ssh --hostname ssh.qzlapp.us.ci

This allows SSH to use Cloudflare Tunnel as its network path while keeping the normal SSH authentication workflow.

9. Connect!

Now comes the fun part.



Simply run:

ssh oci

If Cloudflare Access is configured, you may need to authenticate through your browser first.

After that, SSH uses your private key to authenticate the Linux user.

You should see something similar to:

Last login: Fri Nov  6 09:02:47 2026
[opc@oci-qzl-vnic-1 ~]$

Congratulations! You are now connected directly from your Mac to your private Oracle Cloud VPS.

No Oracle Cloud Shell required!

10. Enjoy Your Normal SSH Workflow

The best part is that you can continue using familiar SSH commands.

Run a remote command:

ssh oci "hostname"

Copy a file to the VPS:

scp file.txt oci:~/

Copy a file from the VPS:

scp oci:~/file.txt .

Forward a remote port to your Mac:

ssh -L 8080:localhost:8000 oci

Then open:

http://localhost:8080

This is particularly useful when developing applications on your VPS.

Conclusion

We have successfully connected a private Oracle Cloud VPS directly from a Mac using Cloudflare Tunnel.

Our setup now provides:

  • No public IP address required

  • No publicly exposed SSH port

  • No need to open inbound port 22 in OCI

  • Cloudflare Access authentication (when configured)

  • Normal SSH key authentication

  • Familiar SSH, SCP, and port-forwarding commands

A private VPS can still be very convenient to manage remotely.

All we need is an outbound Cloudflare Tunnel and the cloudflared client on our Mac.

❤️ Support This Blog


If this post helped you, you can support my writing with a small donation. Thank you for reading.


Comments

Popular Posts

react-native run-android : do not build/update modified code(App.js)

A New Collection of Thoughtful Learning Apps — Now Available on iOS & Android