Skip to main content
duenlim
Staff
Staff
October 28, 2022

Technical Tip: SSH login log show failed with 'ssh_key_invalid' error messages but authentication succeeds

  • October 28, 2022
  • 0 replies
  • 7830 views
Description This article describes how to proceed when SSH login log show failed with 'ssh_key_invalid' error messages but authentication succeeds.
Solution

This issue can occur after upgrading to FortiOS v6.4.10 when uses ssh commands such as 'ssh username@host.nowhere.com'.


SSH login log show 'ssh_key_invalid' but after five seconds event log show successful'.

 

To provide guidance on how to collect debug log:


1) Connect to the equipment via SSH and save the session logs as debug.log. If PuTTY is used, follow this guide for reference:
https://community.fortinet.com/t5/FortiGate/Technical-Tip-How-to-create-a-log-file-of-a-session-using-PuTTY/ta-p/194148

 

# diagnose debug application sshd -1


# diagnose debug app fnbamd -1

 

# diagnose debug console timestamp enable

 

# diagnose debug enable

 

Note: To disable the debug, run 'diagnose debug disable'.

 

2) Connect to the equipment via SSH and save the session logs as sniffer.log.

 

# diagnose sniffer packet any "host x.x.x.x" 6 0 l <- l is small letter of L

 

Note: x.x.x.x is the ssh client IP address.

 

3) Collect the ssh login event log.

 

SSH login will try to authenticate through pubkey first and then password if that fails.


Set the pubkey correctly or when using ssh use an option like '-o PubkeyAuthentication=no'.

 

If the problem continues, contact Fortinet support.

    Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
    Fortinet Flag the Hack. Wednesday, August 26, 9:00 AM - 5:00 PM ET, COSM, Atlanta, GA.
    Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!