SSH Session Monitoring
You set up ssh session monitoring by collecting host login logs and tracking user keys. This process shows your team who enters a server and when they leave. Most teams start by routing traffic through a central jump host or bastion. They also switch from static keys to signed OpenSSH certificates for better tracking. Still, broad server roles still give users full shell control once they log in. A valid login does not stop a bad command from breaking a live system. How native ssh session moni
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.
You set up ssh session monitoring by collecting host login logs and tracking user keys. This process shows your team who enters a server and when they leave. Most teams start by routing traffic through a central jump host or bastion. They also switch from static keys to signed OpenSSH certificates for better tracking. Still, broad server roles still give users full shell control once they log in. A valid login does not stop a bad command from breaking a live system.
How native ssh session monitoring works with OpenSSH
Standard OpenSSH gives teams a built-in way to track who logs into a host. Instead of scattering static public keys across servers, teams use a Certification Authority key. The key signing tool signs a user public key to make a certificate. This certificate holds the public key, an identity string, and valid principal names. It also holds a set of options signed by the authority key. OpenSSH uses a much simpler certificate format than the standard format used in web traffic.
When a user logs in, the server checks the certificate against the trusted key. The server then writes the key identity string and principal name to the host log. Admins set a validity window when they sign each user certificate. Without a set window, the certificate stays valid forever by default. Short windows force users to get fresh certificates often, which keeps host logs current. Teams also funnel these logins through a single bastion host to keep logs in one place.
What native logging solves and what it misses
Native OpenSSH certificates and bastion logs solve the problem of tracking server entry. Your security team can read the host log and see the exact key identity used. You no longer have to guess which engineer used a shared root key on a host. Centralizing logins on a jump host also reduces the number of public entry points. It gives auditors a clean record of login times and source addresses.
Yet this native setup leaves a major gap during active work on the host. The SSH daemon decides who can log in, not what commands do in flight. Once the server accepts the certificate, the user gets an open shell. Host login logs do not show the individual commands a user runs inside that shell. If a user runs a database tool or reads a file, the login log stays silent. Even if a team enables shell history files, a root user can alter or delete them.
SSH Session Recording: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Why shell-level visibility matters for sensitive data
When engineers fix live servers, they often inspect app logs or query local data stores. A standard shell session lets raw data print right to the user screen. That output often includes customer emails, phone numbers, card numbers, or national IDs. Native SSH logging cannot see inside the data stream to rewrite matched fields in results. It also cannot pause a dangerous delete command to ask a peer for approval.
Teams that need real control must move past simple login checks. They need a way to inspect commands before the host runs them. They also need a tamper-proof record of every action taken during the session. Separating entry checks from runtime command checks closes the gap left by native OpenSSH.
Add command and file guardrails to SSH access
Host firewalls and certificate principals control who opens an SSH session. Yet an allowed user or agent can still run a bad one-shot command or pull sensitive files over sftp. In practice, hoop.dev provides an open-source SSH server with guardrails on the host that uses OpenSSH certificates.
Using hoop.dev SSH controls, guardrails check one-shot commands, env variable names, and sftp or scp paths before they run. Port forwards default to deny unless the target is listed. Because interactive shells have no statement boundary and carry no guardrails, teams can turn them off so every command is checked and logged. Check out the MIT-licensed project on GitHub.
Frequently asked questions
Do OpenSSH certificates record the commands a user runs?
No, OpenSSH certificates only handle user and host login checks. The server logs the certificate identity at login, not the commands run inside the shell.
What happens if you do not set an expiration on an OpenSSH certificate?
By default, an OpenSSH certificate stays valid forever if you do not set a window. Teams must specify a validity window during signing to make certificates expire.
Can a bastion host mask sensitive data in terminal output?
A standard SSH bastion only forwards encrypted terminal traffic between the client and the server. It cannot inspect the text stream or mask fields like card numbers or emails.
Related guides
In this post