How to Configure RHEL SFTP Only User
You set up a rhel sftp only user by locking the SSH service to file transfers and a single folder. This stops the account from opening an interactive shell or reading other system files. Many teams give vendors or staff full SSH accounts just to move files. Broad roles let those users run shell commands, browse server paths, and forward network ports. How a rhel sftp only user works in OpenSSH Red Hat servers use the OpenSSH service to handle both terminal logins and file transfers. To lock d
User Provisioning (SCIM) + End-to-End Encryption: the complete guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
You set up a rhel sftp only user by locking the SSH service to file transfers and a single folder. This stops the account from opening an interactive shell or reading other system files. Many teams give vendors or staff full SSH accounts just to move files. Broad roles let those users run shell commands, browse server paths, and forward network ports.
How a rhel sftp only user works in OpenSSH
Red Hat servers use the OpenSSH service to handle both terminal logins and file transfers. To lock down an account, admins first create a dedicated group for file transfer users. Next, they create the user account and add it to that group. They also set the login shell to a non-interactive path as a backup safety step.
The main control lives inside the OpenSSH server settings. Admins add a match rule that looks for the file transfer group. Inside that block, they force the server to run its built-in SFTP process on login. This built-in tool runs without needing external shell files or system libraries.
Admins also set a root folder lock inside the same match block. OpenSSH requires the root account to own the top folder in that locked path. The user cannot have write rights on that top folder either. To let the user upload files, admins make a subfolder inside the locked path. They give the user ownership of that inner folder. They also turn off TCP forwarding and screen forwarding in the match rule.
Using OpenSSH certificates for file transfer logins
Static passwords and bare SSH keys are hard to track across many servers. OpenSSH 5.4 added certificate login support for both users and hosts. An admin uses the key tool to sign a public key with a certificate authority key. The resulting certificate holds the public key, identity details, principal names, and login options.
OpenSSH certificates use a much simpler format than X.509 certificates. When signing a key, the admin sets an identity name and lists valid user principals. They can also embed options that lock the key to a single command or turn off port forwarding. This pairs well with a rhel sftp only user setup on busy hosts.
User Provisioning (SCIM) + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native SFTP locks solve and what they miss
Native OpenSSH rules do a great job of blocking shell access. A locked user cannot leave their assigned folder or run bash scripts. This stops basic lateral movement if a vendor key leaks.
Still, server-level rules only check who logs in and which folder they see. They do not solve key sprawl across dozens of Red Hat hosts. Admins still have to edit settings and fix folder ownership on every single machine. One wrong folder permission breaks the login right away. Also, basic system logs do not give a clear, central view of every action in flight. Teams still struggle to tie shared transfer accounts back to a single person in an identity provider.
Inspect one-shot SSH commands and file tasks
SSH certificates and host rules decide who is allowed on a machine. Setup alone does not check single commands or block sftp reads on sensitive paths. By design, hoop.dev runs an inline open-source SSH listener on the host where engineers and AI agents keep their normal ssh, sftp, and scp tools. On every production command or file operation, hoop.dev decides whether to pass, mask, block, or hold it for approval.
First, hoop.dev guardrails check one-shot commands and file paths before they run, and hoop.dev data masking masks matched values in file downloads. The audit trail logs the certificate principal, requested action, and verdict without storing session content. Interactive shells carry no guardrails and can be turned off when every action must be checked. Explore the code on GitHub.
Frequently asked questions
Why does my SFTP connection close right after login?
OpenSSH drops the session if the locked top folder has bad permissions. The root account must own that folder, and no other user can have write rights on it.
Do I need to copy system binaries into the locked folder?
No, you do not need to copy any binaries or libraries. The built-in OpenSSH SFTP subsystem runs inside memory after login and needs no extra files.
Can an SFTP user still forward network ports through SSH?
Yes, they can forward ports unless you turn it off in your OpenSSH match block. Always disable TCP tunneling and X11 forwarding for restricted file transfer groups.
Related guides
In this post