SSH sharing
Give someone temporary shell access to a machine. No open ports, no Cloudflare account, no SSH server.
| Host (shares) | Remote (connects) | |
|---|---|---|
| Command | cloudify -ssh host |
cloudify -ssh remote |
| Needs | Cloudify, cloudflared | Cloudify, cloudflared, ssh |
1. Share (on the host)#
cloudify -ssh host
It prints an access code and a password. Send them over two different channels.
| Option | Effect |
|---|---|
--ttl 15 |
Stop sharing after 15 minutes (default 60, maximum 1440). |
--once |
Stop sharing when the first session ends. |
--save-code code.txt |
Also write the access code to a file (readable only by you). |
Press Ctrl+C to stop. Every remote is disconnected.
Never share as root. Anyone with the code and the password gets a shell as your user.
2. Connect (on the remote)#
cloudify -ssh remote # asks for the access code, then the password (hidden)
cloudify -ssh remote --code-file code.txt # read the code from a file
cloudify -ssh remote --code cfyssh1.... --password xxxx-xxxx-xxxx-xxxx # the one-line command
The one-line command stays in the shell history, password included.
Run one command or transfer files:
cloudify -ssh remote -- uptime # run one command and return
cloudify -ssh remote -- 'df -h && free -m'
cloudify -ssh remote --sftp # file transfer: put, get, ls, cd, exit
How it is secured: The idea behind it.
Troubleshooting#
| Problem | Fix |
|---|---|
cloudflared not found |
Re-run the installer (Install on Linux). Both machines need it. |
ssh: command not found |
sudo apt install openssh-client (Debian/Ubuntu), sudo dnf install openssh-clients (Fedora/RHEL). |
| The access code is incomplete or damaged | Copy the whole line. |
| This access code has expired, Can't find ... in DNS | The host stopped sharing. Ask for a new code. |
| Could not start the tunnel | The host cannot reach Cloudflare (outbound 443/7844). Try again. |
| Full-screen programs misbehave | Windows host. Commands and SFTP still work. |