Skip to main content
johnathan
Staff
Staff
October 31, 2024

Technical Tip: How to connect to the FortiGate console port on Linux using a USB or built in serial port

  • October 31, 2024
  • 0 replies
  • 3601 views
Description This article describes how to connect to the console port on Linux using either a USB or a built-in serial port.
Scope FortiOS.
Solution

In order to use a serial port to connect to the FortiGate's console port, first find the name of the serial port.

For a USB console cable, this can be usually done by running the following command in the terminal: ls /dev/*tty*.
In the following screenshot, the USB serial cable is located at /dev/ttyUSB0.

 

devtty.PNG

 

If using a serial port built into the PC, generally it is a device under /dev/ttySx
Many serial devices may be visible depending on the specific hardware in the PC.

In order to figure out which one should actually be used, generally this will show up under dmesg. In this case, it is /dev/ttyS0.

Run the following command to see this info: sudo dmesg | grep tty.

 

dmesg.PNG

 

To use the serial port that was found, a program called screen will be used.

This is usually built into most distributions but can be installed with the following command (on Debian-based distros): 


sudo apt install screen 

 

Once installed, open the serial port with the following command:

 

sudo screen <serial port> <baud rate>

screen.PNG
s0.PNG