Fine-grained control through time- and quota-limited API keys
A Rust-based SSH echo server, powered by the russh package, that leverages Unkey's API for secure access management. Unkey enables fine-grained control through time- and quota-limited API keys, adding an extra layer of security to SSH connections. Perfect for developers looking to secure SSH services with modern key-based authentication without sacrificing performance or usability.
create_key
read_key
encrypt_key
decrypt_key
Clone the repository to your local machine:
1git clone git@github.com:unrenamed/unkey-rust-ssh2cd unkey-rust-ssh
Create a .env
file in the root directory and populate it with the following environment variables:
1UNKEY_ROOT_KEY=your-unkey-root-key2UNKEY_API_ID=your-unkey-api-id
Ensure you replace your-unkey-*
with your actual Unkey credentials.
You can use any SSH client that suits you best. Below you'll see how to connect using the OpenSSH toolkit.
Run cargo run
. The server will listen on port 2222
.
In your terminal, connect with:
1ssh <user>@127.0.0.1 -p 2222
When prompted for a password, enter your Unkey API key.
If your key is invalid or expired, access will be denied, and you’ll be prompted again.
Upon entering a valid key, you'll see:
1<user> connected to the server.
Connect another user in a new terminal to see messages broadcasted between users.
2500 verifications and 100K successful rate‑limited requests per month. No CC required.