SSH client chatter can bury the short result that a cron job, remote check, or pasted support transcript needs to show. Quiet mode reduces the OpenSSH client's own warning and diagnostic lines for known-good connections while leaving the remote command output visible.
OpenSSH exposes this behavior at two levels. The -q flag applies quiet mode to one command, and LogLevel QUIET in ~/.ssh/config applies it to a matching host alias. The resolved configuration from ssh -G may report that setting as SILENT, which is the internal log level OpenSSH uses for quiet client logging.
Quiet settings fit routine automation after DNS, host keys, private keys, and authentication already work. They can also suppress connection diagnostics that help during first contact or troubleshooting, so LogLevel ERROR is a better choice when failed connections still need stderr text. Server-side banners, MOTD text, shell startup output, and the remote command's stderr must be handled on the server or in the remote command itself.
Related: How to increase SSH client verbosity
Steps to reduce SSH client output:
- Run ssh with -q for one quiet remote command.
$ ssh -q user@host.example.net "echo ok" ok
-q suppresses most client-side warnings and diagnostics for that connection. It does not remove output produced by the remote command.
- Open the per-user SSH client configuration file when the same host alias should stay quiet every time.
$ nano ~/.ssh/config
Create ~/.ssh/config first if the file does not already exist.
- Add a Host block with LogLevel QUIET for the quiet alias.
Host quiet-remote HostName host.example.net User user IdentityFile ~/.ssh/id_ed25519 LogLevel QUIET
Keep the quiet setting inside a specific Host block. A broad Host * quiet setting can hide warnings for ssh, scp, sftp, and other tools that read the same client configuration.
Tool: SSH Client Config Editor
- Connect through the alias to use the saved quiet setting.
$ ssh quiet-remote "echo ok" ok
If login text still appears before the command output, it usually comes from a server-side banner, MOTD, or shell startup file.
Related: How to suppress SSH login banners and MOTD - Inspect the resolved client settings for the alias.
$ ssh -G quiet-remote host quiet-remote user user hostname host.example.net port 22 ##### snipped ##### loglevel SILENT identityfile ~/.ssh/id_ed25519
ssh -G prints the merged client settings after command-line options, ~/.ssh/config, and system defaults are evaluated. Current OpenSSH accepts LogLevel QUIET in the config file and may print it as SILENT in resolved output.
Related: How to show SSH client configuration - Use LogLevel ERROR when automation should keep hard connection failures on stderr.
$ ssh -o LogLevel=ERROR -o ConnectTimeout=2 -p 2299 host.example.net ssh: connect to host host.example.net port 2299: Connection refused
LogLevel ERROR stays quiet during successful connections but keeps errors such as refused ports visible. Full quiet mode can return a nonzero status for the same failure without printing the client message.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.