Raspberry Pi As SSH Tunnel

Published
Length
3 min read

Luis Felipe Dias

All posts

To use a raspberry pi as ssh tunnel, install OpenSSH and turn on port forwarding. You then route traffic from your client machine through the device to private hosts. Many teams use a small board as a low-cost jump host for remote sites. They often copy static public keys to the device for fast logins. When those accounts have broad shell rights, any user can reach every local service. How to set up a raspberry pi as ssh tunnel The native setup relies on the standard OpenSSH server running on

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

To use a raspberry pi as ssh tunnel, install OpenSSH and turn on port forwarding. You then route traffic from your client machine through the device to private hosts. Many teams use a small board as a low-cost jump host for remote sites. They often copy static public keys to the device for fast logins. When those accounts have broad shell rights, any user can reach every local service.

How to set up a raspberry pi as ssh tunnel

The native setup relies on the standard OpenSSH server running on the Linux board. First, you place the board inside the target network and give it a static address. You then expose its SSH port to your remote users through the router firewall. When a user connects, the client asks the OpenSSH daemon to forward local or remote ports. The daemon opens a TCP socket to the internal target host and relays bytes back.

To manage users at scale, teams often move from static keys to OpenSSH certificates. A central authority signs a user public key to create a certificate. That certificate holds an identity string, principal names, and options signed by the authority key. OpenSSH uses a much simpler certificate format than the X.509 format used in TLS. You can also set a validity time window when signing the certificate. If you do not set a window, the certificate stays valid forever by default. The Raspberry Pi trusts any user certificate signed by your authority key.

What the native tunnel setup solves and what it misses

Using a dedicated board as an entry point keeps other internal ports closed to the internet. You only patch and watch one exposed OpenSSH service on the network edge. Adding OpenSSH certificates stops the need to copy public keys to the board by hand. You can also put options in a certificate or key file to limit port forwarding.

Yet this setup only checks who can log in and open a network pipe. Once the tunnel is up, the OpenSSH daemon just passes raw TCP traffic through. It does not inspect the database queries or shell commands sent inside that tunnel. If an engineer forwards a port to a local database, the board logs only the connection. It cannot block a bad query or rewrite sensitive fields like emails or phone numbers. Also, sharing static keys or long-lived certificates gives users standing rights on the network. If a laptop is lost, the thief gets the same network path until you revoke keys.

SSH Tunneling Security + Authorization as a Service: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Hardening the jump host workflow

Teams should disable full interactive shells on the tunnel host when users only need port forwarding. You can set account rules so the board rejects shell requests and only forwards ports. You should also limit which internal IP addresses and ports each user can reach. Short validity windows on OpenSSH certificates help cut the risk of stolen keys. Even with tight network rules, you still need visibility into the commands run on target hosts. Host firewalls and SSH logs tell you who connected, not what they changed inside the target.

Check SSH commands and file transfers on the host

OpenSSH keys and certificates decide who can log into a Linux host. They do not check what a one-shot command or file transfer does once the session starts. With hoop.dev, you run an open-source SSH server with guardrails on the host. It checks callers with OpenSSH certificates and works with ssh, sftp, scp, and rsync clients.

When a caller runs a one-shot command or moves a file, hoop.dev guardrails check the command or path before it runs. Then hoop.dev data masking masks matched sensitive patterns in downloads and output. Interactive shells carry no guardrails because keystrokes have no statement boundary. Teams can turn interactive shells off and allow only commands and file tasks. The audit trail logs who connected and what was allowed or refused, without storing keystrokes or file bytes. See the source on GitHub.

Frequently asked questions

Can a Raspberry Pi handle multiple SSH tunnels at once?

Yes, a Raspberry Pi can run many concurrent SSH tunnels for normal admin tasks. The main limit is the network card throughput and CPU load during heavy encryption.

Do I need static public keys on the Raspberry Pi for every user?

No, you can configure the OpenSSH server to trust a central certificate authority key instead. Users then log in with signed OpenSSH certificates rather than static public keys.

Does an SSH tunnel log the commands sent to internal servers?

No, the tunnel host only sees encrypted traffic or raw TCP streams passing through the port. It logs the connection event, not the specific commands or queries inside the session.

The query runs. The emails stay hidden.