Hack 14. Debug SSH Client Session

by Ramesh

Sometimes it is necessary to view debug messages to troubleshoot any SSH connection issues. pass -v (lowercase v) option to the ssh as shown below to view the ssh debug messages.

Example without SSH client debug message:

  1. localhost$ ssh -l jsmith remotehost.example.com
  2.  
  3. warning: Connecting to remotehost.example.com failed: No address associated to the name

Example with SSH client debug message:

  1. locaclhost$ ssh -v -l jsmith remotehost.example.com
  2.  
  3. debug: SshConfig/sshconfig.c:2838/ssh2_parse_config_ext: Metaconfig parsing stopped at line 3.
  4.  
  5. debug: SshConfig/sshconfig.c:637/ssh_config_set_param_verbose: Setting variable VerboseMode to FALSE’.
  6.  
  7. debug: SshConfig/sshconfig.c:3130/ssh_config_read_file_ext: Read 17 params from config file.
  8.  
  9. debug: Ssh2/ssh2.c:1707/main: User config file not found, using defaults. (Looked for ‘/home/jsmith/.ssh2/ssh2_config’)
  10.  
  11. debug: Connecting to remotehost.example.com, port 22 (SOCKS not used)
  12. warning: Connecting to remotehost.example.com failed: No address associated to the name