Guide

Configure an SFTP connection

SFTP is the SSH file protocol. It is not FTP with TLS.

DiagramA session path. This page does not open it.
Your PCFile client on Windows
SSHPort 22 · host key checked here
SFTPFile subsystem, not the website
DirectoryExample: /var/www/html
Encryption is the tunnel. The host key tells you which server is at the far end. The directory is a separate choice after login.

The situation

The server offers SFTP, or you run an SSH host with the file subsystem enabled. You need a remote listing over SSH.

Prerequisites

Configure the session

  1. File protocol Set SFTP. The port becomes 22 unless you override it.
  2. Hostname and username Leave the password empty when you use a key, and do not store it with the site unless you accept that.
  3. Key file On Advanced Site Settings → Authentication, set Private key file to the .ppk. That page exists for SFTP and SCP. Details are in the key guide.
  4. Login Compare the host key fingerprint before you continue. The client remembers a key you accept.
  5. Directory Open the path you were assigned.

SCP uses the same port and the same Authentication page. Use it only when SFTP is unavailable. Listings then depend on a shell, resume is not supported, and canceling a transfer ends the session. Select SFTP on purpose when the server has it. The product can fall back from SFTP to SCP, which is not a reason to standardize on SCP.

Example settings

File protocol: SFTP
Hostname: files.example.com
Port: 22
Username: example-user
Private key file: C:\Users\example-user\Keys\site.ppk

The private key stays on your PC. Do not upload it or paste it here.

Expected result

You see the account’s home directory, or the folder you opened. A later connection should not ask about the host key again unless the key changed or the saved data was removed.

Common mistakes

Security

SSH encrypts the password and the files. The host key identifies the server. Your key pair, if you use one, identifies you. Leave agent forwarding and Kerberos delegation off unless you intend the remote host to reuse your credentials.

Troubleshooting

A timeout or refusal is before authentication. An authentication error means the socket worked. If login succeeds and SFTP then fails to start, ask whether the subsystem is enabled. Do not switch to plain FTP as a repair. See the error finder.

Winsaip is an independent educational resource and is not affiliated with or endorsed by the developers of WinSCP.