How to restrict ssh clients to execute arbitrary commands on the remote host.

Solution Verified - Updated -


  • Do not allow ssh clients to execute commands on the remote host instead of a login shell.
  • Force ssh clients to execute the specified command.


  • Red Hat Enterprise Linux
  • ssh

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content