How to Configure RHEL Temporary SSH Access

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up rhel temporary ssh access by signing user public keys with an OpenSSH authority. You also set a strict expiration window on each signed certificate before the user logs in. Most teams start by copying static public keys directly onto Red Hat Enterprise Linux servers. Those old keys often stay on servers long after a contractor or developer finishes work. When users keep broad shell roles forever, one stolen key can expose every production machine. Moving to time-bound certificates fix

SSH Access Management + Customer Support Access to Production: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up rhel temporary ssh access by signing user public keys with an OpenSSH authority. You also set a strict expiration window on each signed certificate before the user logs in. Most teams start by copying static public keys directly onto Red Hat Enterprise Linux servers. Those old keys often stay on servers long after a contractor or developer finishes work. When users keep broad shell roles forever, one stolen key can expose every production machine. Moving to time-bound certificates fixes the problem of forgotten static keys across your fleet.

How rhel temporary ssh access works with OpenSSH certificates

Red Hat Enterprise Linux uses OpenSSH to manage remote logins and check user keys. Instead of trusting individual user keys, you create one central Certificate Authority key pair. You tell the SSH daemon on each Linux host to trust this central authority public key. When an engineer needs to log in, they generate a standard SSH key pair locally. They send their public key to the central signing authority for approval.

The authority signs the public key to make a user certificate. An OpenSSH certificate is much simpler than the X.509 format used for web traffic. It holds the user public key, an identity string, and a list of valid principals. Principals are the specific Linux usernames the certificate allows for the session. The signer also sets a validity window so the certificate expires after a few hours. Note that OpenSSH makes certificates valid forever by default if you skip the expiration setting. Always specify a clear start and end time during the signing step.

Once signed, the engineer presents the certificate to the target Red Hat host. The host checks the authority signature, the valid principals, and the expiration timestamp. If the time window is still active, the server lets the user log in right away. You never have to push new public keys to individual servers or clean them up later.

Managing principals and host key checks

Setting up user certificates is only half of a clean SSH workflow. You also need to map certificates to the right local Linux accounts. Each certificate carries one or more principal names chosen during the signing step. The target server matches those principal names against the requested local Linux account. If a certificate lists a shared admin principal, the user gains full root-level shell control.

You can also sign host keys with your central authority to stop man-in-the-middle warnings. When the authority signs host keys, users do not have to approve fingerprints on first login. Their local SSH client trusts any Red Hat server carrying a valid host certificate. This stops engineers from blindly accepting unknown host keys when connecting to new cloud instances.

SSH Access Management + Customer Support Access to Production: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native SSH certificates solve and what they miss

OpenSSH certificates solve key sprawl and remove the need to distribute static files. When the validity window closes, the user cannot start a new SSH session anymore. Still, native certificates only check who can log in at the start of a session. They do not inspect or control what commands an engineer runs inside an open shell.

If a certificate grants access to a privileged Linux user, the engineer gets full shell power. They can read private files, dump local data containing emails or phone numbers, or stop services. You can attach fixed command options to a certificate, but that breaks normal debugging work. Also, standard SSH logs only record that a login happened with a specific certificate identity. The server does not natively log every command run or rewrite sensitive output in flight. Moreover, an expired certificate does not kill an SSH session that is already open and running. Teams still lack command-level approvals and automatic data masking for sensitive terminal output.

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 sits inline on the host as an open-source SSH server with guardrails that uses OpenSSH certificates. For every one-shot command or sftp task an agent or human runs in production, hoop.dev decides to pass, mask, block, or escalate it for review.

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

What happens if you do not set an expiration window on an OpenSSH certificate?

OpenSSH certificates stay valid forever by default unless you set a validity window when signing. Always set an explicit start and end time so temporary access actually expires on schedule.

Do you need to delete expired SSH certificates from Red Hat servers?

No, because user certificates are never stored on the target Red Hat servers at all. The server only holds the central authority public key and rejects any expired user certificate by default.

Does an expired OpenSSH certificate disconnect an active SSH session?

No, OpenSSH only checks the certificate expiration time when the user first logs in. Any shell session that is already open stays active until the user exits or gets disconnected.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.