Bobcares

Cloudflare Tunnel SSH Without Cloudflared: How to?

by | Jun 8, 2023

Let us learn how to use the cloudflare tunnel ssh without cloudflared with the support of our Server management support services at Bobcares.

How to use SSH for secure remote access without relying on cloudflared?

Cloudflare Tunnel is a Cloudflare service that enables you to securely expose your local servers or services to the internet over Cloudflare’s global network.

To create a secure connection between the server and Cloudflare’s infrastructure, we can use the cloudflared command-line program.

We can set up an SSH tunnel directly to use SSH for safe remote access without relying on cloudflared.

Cloudflare tunnel ssh without Cloudflared

Setup the SSH Server

Install an SSH server on the system that will open up to the internet. Check the accurate set up of the SSH server and we can access it from the internet.

Configuring SSH port forwarding and firewall rules to enable incoming SSH connections is standard.

Enable SSH Port Forwarding

To enable port forwarding on the machine operating as the SSH server, we should modify the SSH server’s configuration file present at:

/etc/ssh/sshd_config

on most Linux distributions and confirm that the GatewayPorts option is Yes.

By doing so, SSH will be able to establish connections with non-local addresses and accept requests for remote port forwarding.

Expose SSH Server to the Internet

Depending on the specific networking setup and the devices we are using, we need to adjust the network router or firewall settings to redirect incoming SSH traffic (typically using port 22).

We have to redirect this to the internal IP address of the machine where the SSH server is running.

Please note that the exact instructions for this step may vary based on the networking equipment and configuration.

Configure SSH Tunnel

Open a terminal on the local machine (client) and use the following command to establish an SSH tunnel to the distant server:

ruby
ssh -R remote-port:localhost:local-port remote-user@remote-server

Replace “remote-port” with the appropriate remote server port where to build the SSH tunnel.

Replace “local-port” with the port number of the local service or server to be exposed.

The remote server’s username is remote-user, and the remote SSH server’s domain or IP address is remote-server.

For example, we may use the following command to expose a local HTTP server operating on port 8080 to the remote server’s port 80:

Access the Service

Once the SSH tunnel is formed, we may use the remote server to access the local service or server.

In the above case, for example, we may reach the local HTTP server by travelling to http://remote-server in a web browser.

We may get secure remote access to local servers or services without depending on the Cloudflare Tunnel service (cloudflared) by simply configuring an SSH tunnel.

To prevent potential security threats, verify that the SSH server and network configurations are safe and appropriately maintained.

[Need assistance with similar queries? We are here to help]

Conclusion

To sum up we have now seen how to use the cloudflare tunnel ssh without cloudflared with the support of our tech support team.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.