SSH Tunneling
SSH Access Methods in Sliplane
Section titled “SSH Access Methods in Sliplane”Sliplane offers two ways to connect to services via SSH:
SSH Tunnel Setup
Section titled “SSH Tunnel Setup”SSH tunneling is ideal when you need to:
- Access private databases from outside the network
- Use SCP or rsync to transfer files
- Set up port forwarding to local development environment
- Connect to multiple private services through a single entry point
Deploy the SSH Tunnel preset. You can keep all the default settings:
After deploying the service (should take <15 seconds), you will find the port, host, and password in the service details.
Copy the host and port and use the following command to connect to your service:
ssh root@<your-subdomain>.sliplane.app -p 2222
It will ask for the password you set in your environment variables.
Using SSH Keys Instead of Password
Section titled “Using SSH Keys Instead of Password”To use SSH key authentication instead of password:
-
Copy your existing SSH public key (usually found at
~/.ssh/id_rsa.pub
):Terminal window cat ~/.ssh/id_rsa.pub -
Add the public key to your SSH tunnel service:
- Navigate to your SSH tunnel service in Sliplane
- Go to the “Environment Variables” section
- Add a new environment variable:
- Key:
SSH_AUTHORIZED_KEYS
- Value: Paste your entire public SSH key
- Key:
-
Update authentication method:
- Remove the
ROOT_PASSWORD
environment variable if you only want key-based authentication - Or keep both for dual authentication methods
- Remove the
-
Restart the service to apply changes
-
Connect using your SSH key:
Terminal window ssh root@<your-subdomain>.sliplane.app -p 2222No password prompt will appear if your key is correctly configured.
For implementation details, see the Github Repository.
Once you are connected, you are in the same network as all your private services. You will be able to reach them via their service name.
You can also tunnel other private services to localhost by using port forwarding.
ssh -L 8080:<your-app.internal>:<your-app-port> root@<your-subdomain>.sliplane.app -p 2222
Here port 8080
on your local machine will be forwarded to port your-app-port
on your service. The ports as well as the host are configurable and depend on the service you want to reach.
If you want to have console access to your service you will have to install a SSH server on the service you want to access. To learn how to do that, check out the SSH Server repository.