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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for CFsshTunnel-0.1.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 681ac20a06a10095d4d25775be6de42e7795a23c102581599b36533b3a8951db |
|
MD5 | c8602bc87c777bc4df6b61b10bc8c971 |
|
BLAKE2b-256 | ef87c2c1841bace2999660a1f0267180e90f3ad43036a50f0b75bcc3d242f06f |