Silencing unnecessary SSH client output keeps interactive sessions and automation clean, especially when only remote command results matter. Connection banners, login notices, and diagnostic lines can otherwise clutter logs, make pipeline parsing fragile, or obscure the information that actually needs attention.

The OpenSSH client controls its chatter with the quiet flag ‑q, the LogLevel setting, and configuration files in /etc/ssh/ssh_config and /~/.ssh/config. Adjusting these options changes which messages are printed while leaving remote stdin, stdout, and stderr streams untouched, so remote programs continue to behave normally.

Aggressive quiet settings can hide host key warnings, authentication hints, and other diagnostics that help detect misconfiguration or attacks. Quiet modes suit stable, well-tested automation and scripted use, while higher LogLevel values or verbose flags remain important for troubleshooting on Linux, macOS, and Windows 11 terminals that use OpenSSH.

Steps to minimize and silence SSH output:

  1. Open a terminal on the local machine.
  2. Run a standard SSH connection to observe the normal banners and informational messages.
    $ ssh user@remotehost
    user@remotehost's password:
    Welcome to Ubuntu 22.04.4 LTS (GNU/Linux 5.15.0-94-generic x86_64)
    ##### snipped #####
  3. Use the quiet flag to suppress most client banner and warning output during connection.
    $ ssh -q user@remotehost
    Welcome to Ubuntu 22.04.4 LTS (GNU/Linux 5.15.0-94-generic x86_64)
    ##### snipped #####

    The ‑q flag enables quiet mode for ssh and behaves like setting LogLevel to QUIET for that single command.

  4. Apply an error-only log level so that only failures are printed while routine informational messages are hidden.
    $ ssh -o LogLevel=ERROR unreachable.example
    ssh: connect to host unreachable.example port 22: Connection timed out

    LogLevel=ERROR keeps the connection noisy enough to show problems while removing banners and less important notices.

  5. Combine quiet and LogLevel options for minimal client noise while still showing remote command output.
    $ ssh -q -o LogLevel=QUIET user@remotehost "echo ok"
    ok

    Quiet options affect only SSH client messages; remote command output still appears unless redirected on the remote side.

  6. Open the per-user configuration file /~/.ssh/config in a text editor.
    $ nano ~/.ssh/config
  7. Add a host block that enables quiet behavior by default for a specific target.
    Host quiet-remote
      HostName remotehost
      User your-username
      LogLevel QUIET

    Setting LogLevel QUIET for a broad pattern such as Host * can hide important host key change or warning messages for all connections.

  8. Connect using the configured host alias so that the quiet defaults from /~/.ssh/config are applied automatically.
    $ ssh quiet-remote
    Welcome to Ubuntu 22.04.4 LTS (GNU/Linux 5.15.0-94-generic x86_64)
    ##### snipped #####
  9. Inspect the computed configuration for the alias to confirm the effective LogLevel value.
    $ ssh -G quiet-remote | grep -i loglevel
    loglevel QUIET
  10. Increase LogLevel or enable verbose flags when detailed diagnostics are required again.
    $ ssh -v -o LogLevel=INFO user@remotehost
    OpenSSH_9.2p1 Ubuntu-2ubuntu0.1, OpenSSL 3.0.2 15 Mar 2022
    ##### snipped #####

    Higher LogLevel values and verbose flags expose connection details useful for troubleshooting; related options are described in How to display detailed information of an SSH connection.

Discuss the article:

Comment anonymously. Login not required.