Imagine a scheduled SFTP job that exchanges sensitive files with a business partner every night. Nobody’s there to type a password, and you certainly don’t want that password sitting in a script for years. So how does the server know it’s connecting to the right system?

That’s where SSH public key authentication comes in. Instead of relying on a secret someone can remember, type, or accidentally give away, it uses a pair of cryptographic keys. For SFTP connections, that can mean fewer passwords to manage and a better way to authenticate automated transfers. But what do those keys actually do?


What is public key authentication and how does it work?

SSH key authentication uses two mathematically related keys: one public, one private. You can register the public key with a server, but the private key must stay confidential. Don’t email it to a partner or upload it to the SFTP server. The public key is the part you share.

When a client connects, it uses the private key to sign authentication data. The server checks the signature against the public key registered for that account. A valid signature tells the server that the client has the corresponding private key, without that key ever being transmitted.

That’s the clever part. The server can verify that the client holds the right private key without receiving the key itself. The SSH authentication protocol describes how this works.


Why use SSH keys instead of passwords?

Now that you know a bit about SSH keys, why use them instead of the old, familiar password? The main reason is still security, but there’s a practical advantage too!

Passwords can be compromised in all sorts of ways: through brute-force attacks, phishing, social engineering, or reuse across accounts. Oh, and let’s not forget the embarrassing possibility of somebody finding a password written down so it won’t be forgotten.

Obtaining a registered public key doesn’t give an intruder access. They’d still need the corresponding private key, and a properly generated key isn’t realistically guessable in the way a weak password can be. That changes what an attacker has to steal.

  • Resistance to guessing: A properly generated SSH key isn’t based on a memorable phrase or predictable password pattern.
  • No password in the job: Scripts and transfer applications can authenticate without storing an account password.
  • Reliable automation: Scheduled transfers can run without waiting for someone to enter credentials.
  • More control: Use separate keys for different integrations. If a partner or system no longer needs access, remove its key without disrupting the others.

Of course, a private key is still a secret. If someone copies an unprotected key, they may be able to authenticate with it. Keep it in secure storage, restrict who and what can read it, use a passphrase where practical, and retire keys you no longer need.

For unattended jobs, use an appropriately protected secret store or key-management mechanism rather than leaving private keys lying around in ordinary files.


Are passwords ever the better choice?

Not every SFTP connection is unattended. People may still use passwords for interactive access, particularly where strong password controls are in place. However, for a script that sends files at 2 a.m., asking someone to type a password defeats the purpose. SSH keys are usually the more sensible option.

One point that often gets confused: SSH password authentication is encrypted in transit too. The problem isn’t a password travelling openly over the network. It’s the risk of that reusable credential being stolen or guessed. SSH transport encryption protects the connection, while public key authentication establishes who’s connecting. They do different jobs.

For a new key pair, Ed25519 is a strong choice if both ends support it. RSA with SHA-2 signatures is still useful when you’re connecting to older systems. Always verify the server’s host key, too. Even the strongest client key won’t help if you connect to an impostor.


Using SSH key authentication with SFTP To Go

With SFTP To Go, you can authenticate SFTP connections using SSH public keys or a username and password. Administrators can also enforce public key authentication for their organization, rather than leaving every credential to make its own choice.

Getting started doesn’t take much: generate a key pair, register the public key with the relevant SFTP credential, and configure the client to use the private key. The private key stays with the client. Our SSH key authentication guide explains the process.

SFTP To Go accepts Ed25519, RSA, and ECDSA keys. Authentication is only one part of securing access. You can restrict inbound IP addresses, confine credentials to particular folders and operations, and review authentication and file-transfer logs. SFTP traffic is encrypted over SSH, while stored files are encrypted at rest.

For outbound automation, the authentication process works a little differently. If an SFTP To Go Connection signs in to a partner’s SFTP server, it can use a private key you provide or a newly generated key pair. The Connections documentation explains those options and how to configure them.

A public key is safe to share. The private key isn’t. Protect that private key, keep permissions narrow, and use separate keys for separate integrations. Those habits make automated SFTP transfers safer without making them harder to manage.


Frequently asked questions

Is SSH key authentication more secure than a password?

Generally, yes, especially for automated SFTP transfers. SSH keys resist password guessing and avoid the need to submit a reusable password during authentication. An exposed private key is still a serious risk, so key protection remains essential.

Can SSH keys be stolen?

Yes. Malware, backups, poorly secured devices, and accidental disclosure can expose private keys. Store them securely, use a passphrase where practical, and promptly remove compromised keys from authorized accounts.

Can I use both an SSH key and a password?

SSH supports different authentication methods, and some servers can require multiple methods. SFTP To Go supports passwords and public keys for SFTP, and organizations can enforce public key authentication. Don’t assume that enabling both options means both are required for every login.

Which SSH key type should I use?

Ed25519 is a strong default for new SSH keys when supported by your systems. RSA keys using SHA-2 signatures remain an option for compatibility. Avoid confusing an RSA key with the older SHA-1-based ssh-rsa signature algorithm.

Is passwordless SFTP safe for automated transfers?

Yes, when private keys are properly secured. It avoids placing reusable passwords in scheduled jobs or application configuration, but credentials should still have restricted permissions and be reviewed regularly.

Does SSH key authentication encrypt files?

No. Public key authentication proves that the client is authorized. The SSH transport protocol encrypts data while it travels between the client and server. Encryption at rest is a separate protection.