Configure SSH Client to Suppress Warnings on Ubuntu

When connecting to remote servers via SSH on Ubuntu Linux, non-critical warning messages can clutter your terminal. This guide provides a straightforward walk-through on how to configure your SSH client to suppress these warnings by adjusting the LogLevel configuration setting, ensuring a cleaner and more focused command-line experience.

Understanding the LogLevel Directive

The SSH client’s LogLevel parameter controls the verbosity of the messages printed to your terminal. By default, this is usually set to INFO. To suppress warnings, you can change this setting to one of the following values:

You can apply this change globally for all users, individually for your user account, or temporarily for a single command.


To suppress SSH warnings only for your logged-in user account, modify your personal SSH configuration file.

  1. Open your user SSH configuration file using a text editor:

    nano ~/.ssh/config

    (If the file does not exist, this command will create it).

  2. Add the following configuration block to the file to apply the setting to all remote hosts:

    Host *
        LogLevel ERROR

    (Replace ERROR with QUIET if you want to silence errors as well).

  3. Save and close the file. In Nano, press Ctrl+O, Enter, then Ctrl+X.

  4. Set the correct file permissions to ensure security:

    chmod 600 ~/.ssh/config

Method 2: System-Wide Configuration

To suppress SSH warnings for every user account on your Ubuntu system, modify the global SSH configuration.

  1. Open the global SSH configuration file with administrative privileges:

    sudo nano /etc/ssh/ssh_config
  2. Scroll down to find the Host * section. If it does not exist, add it to the bottom of the file.

  3. Add or modify the LogLevel line under the Host * block:

    Host *
        LogLevel ERROR
  4. Save and close the file (Ctrl+O, Enter, Ctrl+X).


Method 3: Suppress Warnings for a Single Session

If you want to run a specific SSH command without permanently changing your configuration files, you can pass the LogLevel option directly in your terminal command:

ssh -o LogLevel=ERROR user@remote_host