WinSCP Without Passwords: SFTP Sites, SSH Keys and Auto-Sync
Save your server as a WinSCP site, log in with an SSH key and let every saved file land on the server by itself.
It's late, the website needs one tiny CSS fix, and you've just typed the server password for the third time today because WinSCP forgot the session again. Then you edit the file locally, drag it across, refresh the page and realize you uploaded the wrong copy. WinSCP can do all of that for you: remember the server, log in with a key instead of a password and push every saved file to the server on its own.
WinSCP is a free SFTP, SCP and FTP client for Windows, currently at version 6.7. This guide builds a proper setup in four steps.
Step 1: Create your first SFTP site
When WinSCP starts, the Login dialog opens. That's where every connection begins.
- Select New Site in the tree on the left.
- Set File protocol to SFTP.
- Type the server name or IP address into Hostname. WinSCP fills in Port number 22 automatically, so change it only if your host uses a different SSH port.
- Enter your Username.
- Leave Password empty if you plan to save the site.
File protocol, hostname and username are all you need. Save turns the session into a reusable site.
Why skip the password? Because WinSCP will simply ask for it when you connect, and a password that never touches your disk can't leak from it. If you do want it saved, protect your stored passwords with a master password in WinSCP's preferences first.
Step 2: Save it as a site
- Click Save.
- In the Save session as site dialog, give the site a clear name, such as "Blog live server".
- Optionally pick or type a Folder to group sites, for example "Work" and "Private".
- Tick Create desktop shortcut if you want one-click access from the desktop.
- Click OK.
The site now appears in the tree. Double-click it to connect. On the very first connection, WinSCP shows you the server's host key and asks if you trust it. Compare it with the fingerprint your host publishes if you can, then accept. If the same warning appears later for a server you already know, stop and ask your host why its key changed.
To change a saved site, select it and click Edit. To base a new site on an existing one, use Manage > Clone to New Site.
Step 3: Switch to key-based login
Passwords can be guessed and phished. An SSH key pair can't, as long as the private half stays on your PC. WinSCP uses keys in PuTTY's .ppk format, but it converts other formats for you.
Make a key pair
If you don't have one yet, open your site with Edit, click Advanced..., go to SSH > Authentication, and choose Tools > Generate New Key Pair with PuTTYgen. PuTTYgen, the key generator that comes from the PuTTY project, opens. Generate the key, set a passphrase and save the private key. WinSCP notices the new file and puts its path into the Private key file box automatically.
Put the public key on the server
The server must know your public key before it lets you in. On an OpenSSH server, WinSCP does that in one go:
- Connect once with your password.
- Choose Tabs > Install Public Key into Server in the main window.
- Select your key pair and confirm.
The same command is also available under Tools on the SSH > Authentication page. It works like the ssh-copy-id script on Linux. If you prefer doing it by hand, click Display Public Key, copy the text and paste it as one line into the file authorized_keys in the .ssh folder of your home directory on the server. The .ssh folder should have permissions 700 and the file 600, or the server may ignore the key.
Tell the site to use the key
- Select the site, click Edit, then Advanced....
- Open SSH > Authentication.
- Click the ... button next to Private key file and pick your key.
- Click OK and Save.
SSH > Authentication: point Private key file at your key, and WinSCP uses it on every login.
Already have an OpenSSH key, the kind that sits in a file called id_ed25519 or id_rsa? Select it anyway. WinSCP offers to convert it to PuTTY format and saves a .ppk copy, leaving the original untouched.
Tired of typing the key's passphrase? Load the key into Pageant, PuTTY's authentication agent. Attempt authentication using agent is on by default on the same page, so WinSCP picks up keys from Pageant without asking.
Step 4: Keep the server in sync
Now for the part that saves the most clicks. WinSCP has two sync tools, and they serve different moods.
Synchronize once
Commands > Synchronize compares a local and a remote folder and transfers the differences. Pick the direction: Remote applies your local changes to the server, Local pulls changes from the server, Both updates both sides. As the mode, Synchronize files sends newer files, while Mirror files also overwrites newer target files with older source copies. Leave Preview changes on. You get a checklist of every planned action and can untick anything before it happens. Be careful with Delete files, which removes target files that no longer exist in the source.
Keep the remote directory up to date
This one is a WinSCP specialty. It watches a local folder and uploads every change the moment you save.
- Open both folders in the Commander interface: local on the left, remote on the right.
- Choose Commands > Keep Remote Directory up to Date.
- Check the two paths under Watch for changes in the local directory and ... and automatically reflect them on the remote directory.
- Tick Update subdirectories if the project has subfolders.
- Tick Synchronize on start so both sides start out identical.
- Click Start.
Two paths, a few checkboxes, Start. From now on every save goes straight to the server.
Edit in your favorite editor, press Ctrl+S, and the change is on the server seconds later. Press Stop when you're done. Two warnings from the WinSCP documentation are worth repeating. WinSCP sees only that something in a folder changed, so it syncs the whole folder, which is why it should start from a synced state. And a rename looks like a deletion plus a new file, so rename big folders manually on the server instead. To leave backups or logs behind, set a file mask under Transfer settings..., for example to exclude *.bak.
Our verdict
WinSCP is the right tool for anyone who maintains a website, a home server or a Raspberry Pi from Windows. Saved sites and keys make logins painless, and keep-up-to-date turns a remote server into something that feels local. Your one job today: save your server as a site and switch it to a key.


