Description | This article provides an example of SSH session logging when using Linux or MacOS to connect to FortiGate. |
Scope | FortiGate. |
Solution |
By default, the tee command will overwrite the filename given. To append instead, use '-a' as below. ssh -l admin 10.21.8.9 | tee -a ssh_session.log Once created, the log file is readable using a text editor or the 'cat' command.
For serial console connections, one option is the 'screen' command with 'L' to enable logging. The serial console driver and device must already exist.
fortinet@demo:~$ sudo dmesg | grep tty
For Windows endpoints, Putty is a commonly used terminal emulator and SSH client application for Windows devices. It can be used to collect a long-running diagnostic from a Fortinet device when an HTTPS diagnostic is not suitable. It also supports serial console connections.
Related article: Technical Tip: How to create a log file of a session using PuTTY |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.