Originally posted on https://ftpgrid.com/tutorials/create-ssh-keys-for-sftp-scp-authentication
In this tutorial we show how to create your own SSH keys for key based authentication against a SFTP or SCP host like ftpgrid.com. If you’re still using passwords to authenticate SFTP or SCP access, it’s time for an upgrade. Not only are passwords inherently insecure in today’s threat landscape, but they also get in the way of automation, scripting, and scalable workflows.
This blog post covers:
Why SSH keys are the preferred authentication method for secure file transfers
The differences between SSH key types
How to generate your own SSH key pair
How to connect to ftpgrid.com using your SSH key
Let’s dive in.
SSH Keys vs. Passwords: Pros and Cons
Passwords are easy to get started with but offer little in terms of long-term security or convenience. They’re vulnerable to brute force attacks, phishing, and reuse across systems. More importantly, they’re a pain to use in automated scripts or CI/CD pipelines.
SSH keys, on the other hand, are:
Far more secure (especially when passphrase-protected)
Non-interactive (perfect for automation)
Easier to rotate or revoke
Supported by virtually every modern SSH client and server
Common SSH Key Types Explained
Not all SSH keys are created equal. Here’s a quick overview of the most common types:
- ssh-rsa
Based on RSA encryption (public/private key pair)
Historically the default key type
Still widely supported, but slowly being phased out due to security concerns with older SHA-1 signatures
- ecdsa-sha2-nistp256
Based on elliptic curve cryptography (ECC)
More compact than RSA, with similar security
Supported by most modern systems, but some older clients may lack compatibility
- ssh-ed25519
The newest and most secure default
Extremely fast and lightweight
High security with small key size
Preferred for new setups
Recommendation: Use ssh-ed25519 unless you have a specific reason not to (e.g. legacy system support, but ftpgrid.com fully supports ssh-ed25519).
How to Generate SSH Keys
To generate a new SSH key pair on your local machine, use:
ssh-keygen -t ed25519 -C "your_email@example.com"
Or for RSA (if needed):
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
You’ll be asked where to save the key (default is ~/.ssh/id_ed25519) and whether you want to protect it with a passphrase (recommended).
Once generated, you’ll have:
A private key (keep this secure!)
A public key (you can upload this to ftpgrid.com)
Connecting to ftpgrid.com Using SSH Keys
Assuming your public key is now registered with your ftpGrid user, if not go to app.ftpgrid.com -> FTP accounts, here’s how to connect:
Using SFTP, where edgeN is your assigned edge server, for instance edge7.ftpgrid.com:
sftp -i ~/.ssh/id_ed25519 youruser@edgeN.ftpgrid.com
Using SCP, where edgeN is your assigned edge server, for instance edge7.ftpgrid.com:
scp -i ~/.ssh/id_ed25519 localfile.txt youruser@edgeN.ftpgrid.com:/upload/
No password prompts. Fully scriptable. End-to-end encrypted.
Final Thoughts
Passwords are a thing of the past when it comes to secure file transfer. SSH keys give you the tools for robust, scalable, and secure SFTP/SCP operations – and they’re easy to set up.
If you are not already, sign up to ftpGrid.com now, or read more on our features page.
Top comments (0)