SSH authentication is widely regarded as the most secure and reliable method for accessing an SFTP server. It uses the Secure Shell (SSH) protocol to establish an encrypted connection, ensuring that data transferred between the client and server remains private and protected from interception. Unlike basic password authentication, SSH key-based authentication adds an extra layer of security by requiring a private key on the client side that matches a public key stored on the server. This eliminates the risk of brute-force attacks or stolen credentials, as the private key never gets transmitted. Additionally, SSH keys can be further secured with passphrases and are easier to automate safely in scripts and scheduled tasks, making them ideal for both human and system-level access. Overall, SSH authentication combines strong encryption, identity verification, and secure automation, making it the best practice for accessing SFTP servers. These steps will help you generate a new SSH key pair using your terminal on Linux, macOS, or Windows We will need only your public key (that is safe to share and helps us set up authentication). Your private key will also be created (and protected by the passkey) - keep it to yourself and never share it with anyone!
✅ Step 1: Open your terminal
- macOS: Open the Terminal app
- Linux: Use your default terminal
- Windows: Use PowerShell or Terminal
✅ Step 2: Check for existing SSH keys
Run this command to see if you already have SSH keys:- id_rsa / id_rsa.pub
- id_ed25519 / id_ed25519.pub
✅ Step 3: Generate a new SSH key pair
Use the ssh-key command to generate a new SSH key pair:✅ Step 4: Choose the file location
You’ll be prompted:- Press Enter to accept the default - we recommend this option
- Or enter a custom path if needed
⚠️ If the file exists, you’ll be asked to overwrite - only do this if you’re sure you want to do that!
✅ Step 5: Set a Passphrase
You’ll see:- Type a secure passphrase (you won’t see characters as you type)
- Press Enter, then confirm
🔐 A passphrase protects your private key, you will need it to authenticateAt this point, you should have both your public and private keys created. Typically, your private key is the file without the extension (id_ed25519), while your public key has .pub as the file extension (id_ed25519.pub)
✅ Step 6: View your public key
Whether you already had it or just created it, let’s quickly check if everything went well. Run:Next: Step 2 - Share your SSH public key with us