OpenSSH Troubleshooting: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 23: Line 23:
==Turn On Debug Logging==
==Turn On Debug Logging==


Stop the current sshd server (stopping the server won't drop the existing connections), increase logging verbosity as described here: and restart the server.
Stop the current sshd server (stopping the server won't drop the existing connections), increase logging verbosity as described here: [[Sshd_Configuration#Logging_Verbosity|sshd Logging Verbosity]],  and restart the server.


  systemctl stop sshd
  systemctl stop sshd
  # update logging verbosity
  # update logging verbosity
  systemctl start sshd
  systemctl start sshd

Revision as of 21:08, 2 July 2017

Internal

Connection Takes a Long Time

In most cases this is caused by the server attempting to use DNS to get the IP name of the client. It is fixed by turning 'UseDNS' off. For more details, see:

Turn Off Client Name DNS Verification

Troubleshooting sshd Server

Execute the sshd Server in Foreground

One method to troubleshoot a sshd server in an attempt to figure out why a specific ssh connection does not work as intended, is to stop the current sshd server (stopping the server won't drop the existing connections) and start it in foreground:

systemctl stop sshd

/usr/sbin/sshd -d [-D] [-d] [-d]

sshd running in foreground behaves differently than the same binary running in background - for example, a foreground server will allow root logging with a public key without password, while the background server won't, so this method has limited usefulness in some cases.

Turn On Debug Logging

Stop the current sshd server (stopping the server won't drop the existing connections), increase logging verbosity as described here: sshd Logging Verbosity, and restart the server.

systemctl stop sshd
# update logging verbosity
systemctl start sshd