If you've spent any time configuring user authentication on... Full Story
By Manny Fernandez
December 30, 2025
Using Multiple SSH Keys in SecureCRT and macOS CLI
When you have multiple customers or multiple servers in your environment and you want to use multiple SSH keys to connect here is how to do it on both SecureCRT and via the macOS/Linux CLI.
SecureCRT
When you open SecureCRT, go to Tools then Create Public Key

On the Key Generation Wizard choose Continue

Next we can choose the Key Type . RSA is being phased out so I use ED25519

Then we want to choose a Passphrase . Note: This will be asked each time you connect. I do not recommend leaving the passphrase blank.

Next we have Key Length . With ED25519 the default is 256
The key will now generate

Now hit Continue to save the key pair.
I am using iCloud Drive to sync my Documents and Desktop. I have my Vandyke folder in my Documents folder so it is synchronized to all my macBooks and Mac Studio. It ~/Documents/Vandyke/Configs/Keys

Give it a meaningful name and hit Save

I like to use the OpenSSH Key Format so I can use them via CLI if SecureCRT fails.

Since we want to use multiple keys, your answer to this should be No

If you browse to the folder, you will see two files with the name you gave the key pair above. The .pub is the public part of the key pair, while the one without an extension is the private key, which you should not share. Makes it easy to remember.
SecureCRT Session
Now lets create a new Session although you can use an existing Session as well.
Lets create a new Session

Under Protocol, we will choose SSH2

Give the Session an IP address or FQDN

Give it your username in the case of a FortiGate (see below for the FortiGate Config)

Name the Session and click Done
Now right click on the new Session and go to Properties and click on SSH2

Now we will (1) click on the PublicKey In the center, and use the arrows (2) on the right to move the Authentication method to the top. Then choose the cog (3).

No browse to your .pub file and hit OK
Configuring the FortiGate for SSH Key Auth
On the FortiGate, you will need to go to the admin user section by typing the following

Make sure you use the "". You can cat or edit the .pub file. Save the key info.

Ensure you have SSH enabled on the administrative access of the Interface you are planning to connect to the FortiGate on.

macOS / Linux Command Line
On the CLI for macOS and Linux, the default location for the SSH keys is in the ~/.ssh of each user home folder.

- I am showing the working directory with the pwd command
- I am showing the files currently in the directory by typing the ls command
- I am not going to use the
ssh-keygento generate the key-pair. The-Tmeanstypethen I am telling to use theed25519rather than thersadefault, then the-CIs a comment. - You will be asked what you want to name this key-pair
- You will be asked to give it a passphrase for this key-pair.
Now when we run an ls we can see the two new files

Getting the public keys to the server
On Linux boxes and other supported platforms, you can use the ssh-copy-id command to push the key to the server in question. The command for that is:
ssh-copy-id -I ~/.ssh/FortiGate.pub and enter. It will ask you to auth with a password.
NOTE: This does NOT work on the FortiGate (even though I used the name here). You will need to follow the Configuring the FortiGate for SSH Key Auth
To connect to a server using the key, the syntax is as follows ssh -I ~/.ssh/FortiGate NOTE: You are using the Private portion of the key pair.
You can use ssh-agent to cache the files, but I do not.
Recent posts
-
-
DNS is one of those technologies that quietly underpins... Full Story
-
BGP issues on FortiGate firewalls usually trace back to... Full Story
-
Every time your laptop talks to your router, a... Full Story
-
If you've spent any time configuring NAT on a... Full Story
-
If you have spent any time configuring firewall policies... Full Story
-
High availability on FortiGate is one of those features... Full Story
-
If you've configured SD-WAN on a FortiGate, you've almost... Full Story
-
FortiLink is the management protocol that turns a FortiSwitch... Full Story
-
FortiSwitches are pretty rock solid from Mean Time Between... Full Story
-
This is a quicky tip. Have you ever gone... Full Story
-
DNS is one of those quiet pieces of internet... Full Story
-
This article is an updated version of the previous... Full Story
-
You will add ns2 as a secondary (slave) BIND9... Full Story
-
In the process of deploying my lab, I needed... Full Story
-
RFC 8805, used to be known as Self-Correcting IP... Full Story
-
Years back, I wrote an article about certificate pinning. ... Full Story
-
FortiGates have the ability to send alerts to Microsoft... Full Story
-
In this post, I am going to walk through... Full Story
-
Troubleshooting VoIP on a FortiGate can feel like trying... Full Story
-
Prior to FortiOS 7.0, there were three commands to... Full Story
-
In this post, I am going to go over... Full Story
-
What we are going to do: We are going... Full Story
-
Choosing between FGCP (FortiGate Clustering Protocol) and FGSP (FortiGate... Full Story
-
Creating a VLAN on macOS (The "Pro" Move) A... Full Story
-
This blog post explores the logic behind how macOS... Full Story
-
Pretty Fly for a Wi-Fi Tell My Wi-Fi Love... Full Story
-
Part of my daily gig is creating BoMs (Bill-of-Materials)... Full Story
-
ICMP introduces several security risks, but careful filtering, rate... Full Story
-
The command diag debug application dhcps -1 enables full... Full Story
-
In the world of FortiOS, execute tac report is... Full Story
-
LLDP; What is it The Link Layer Discovery Protocol... Full Story
-
What it actually does When you run diagnose fdsm... Full Story
-
Monkey Bites are bite-sized, high-impact security insights designed for... Full Story
-
I have run macOS in macOS with Parallels but... Full Story
-
Don't be confused with my other FortiNAC posts where... Full Story
-
This is the third session in a multi-part article... Full Story
-
Today I was configuring key-based authentication on a FortiGate... Full Story
-
Netcat, often called the "Swiss Army knife" of networking,... Full Story
-
At its core, IEEE 802.1X is a network layer... Full Story
-
In case you did not see the previous FortiNAC... Full Story
-
This is our 5th session where we are going... Full Story
-
Now that we have Wireshark installed and somewhat configured,... Full Story
-
The Philosophy of Packet Analysis Troubleshooting isn't about looking... Full Story
-
Overview FortiOS 8.0 introduces custom tags as a first-class... Full Story
-
These are two distinct mechanisms on FortiOS, and conflating... Full Story
-
Replacement messages are the pages and text blocks that... Full Story