How to Run SSH in Verbose Mode on Ubuntu

This article explains how to run the SSH client in verbose mode on Ubuntu Linux to troubleshoot and debug connection issues. By enabling verbose logging, you can view the step-by-step handshake process, authentication attempts, and configuration errors that may be causing your SSH connection to fail.

To enable verbose mode in the Ubuntu SSH client, you use the -v option. SSH supports three levels of verbosity, with each additional v providing deeper debugging details.

Level 1 Verbosity (-v)

This level prints basic debugging messages about the connection progress. It is useful for identifying general connection stages and seeing which authentication methods are being tried.

ssh -v username@hostname

Level 2 Verbosity (-vv)

This level displays more detailed information, including local and remote port forwarding details, cryptographic socket interactions, and channel activity.

ssh -vv username@hostname

Level 3 Verbosity (-vvv)

This is the most detailed debug mode. It outputs extensive tracing data, which is highly useful for diagnosing complex SSH configuration issues, private key mismatches, or server-side restrictions.

ssh -vvv username@hostname

Key Areas to Analyze in the Verbose Output

When troubleshooting your connection, pay close attention to these specific stages in the output: