Skip to main content

Cloudflare Tunnel for open-ssh and code-server

Project description

open-ssh linux server creation and tunneling through cloudflare tunnels

- sshd_config and cloudflare_config parameters can be changed as required
- connect to the tunneled server from either windows or linux ssh client through the domain assigned

Server dependencies: python>=3.5, pip, python-apt, make

Client dependencies: ssh, Cloudflared installation: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation

Installation

pip install

pip install CFsshTunnel

Uninstall

pip uninstall CFsshTunnel

manual installation

- run `make build pip-install` to build and install the package
- run `sudo make test` to test server and client functionality (requires server's pub rsa key to run the test successfully)

Launching server

through make

- run `sudo make launch_server` on linux server to start the server tunnel (launches with all default config)

from within python source/notebooks

import CFsshTunnel
#Run either with all default parameters or pass ssh/cloudflare config as required
CFsshTunnel.CFsshTunnel()

Code-Server

Launching code-server and mapping to tunnel domain

from CFsshTunnel.code_server.code_server import launch_codeserver
#cloudflare config and port designation can be specified as required
launch_codeserver()

Connecting to code server

	just open the tunnel domain on any browser
	password prompt should be visible asking for password from ~/.config/code-server/config.yaml or as configured in the code-server config.yaml(ex: cert)

execute as root/sudo user since python-apt, /etc/ssh/sshd_config and ~/.ssh/config require that access

In case of runtime error due to failure to acquire cloudflare tunnel, just restart the server, should work in a try or two

ssh Port designation is set to random between 49153 to 65534 unless specified

cloudflare logging should be available as ./cloudflared.log

cloudflare metrics will be on http://localhost:metrics_port

Successful server tunneling will give a similar terminal output with details for client config and connection image

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

CFsshTunnel-0.1.7.tar.gz (7.4 kB view hashes)

Uploaded Source

Built Distribution

CFsshTunnel-0.1.7-py3-none-any.whl (22.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page