Fix WinSCP Connection and Permission Errors

On this page

Quick answer. Copy the full message, note whether it appeared before any file list, and match it to one section below. A refusal or a timeout is a network or port problem. Access denied at login is authentication. Permission denied on a path is the account’s rights on that path. None of these is fixed by mode 777, by turning off the host-key check, or by disabling a firewall you do not control.

Use the search box and type the words from your message, or jump from this list:

Diagram grouping WinSCP failures by when they appear: before login, at the host-key prompt, on a single path, or during a copy.
The moment the message appears is the diagnosis. Write down the protocol, port, and path with the message text.

What to record before you change anything

  • The full sentence WinSCP showed, including a code such as 3 if one is present.
  • The protocol and the port from the saved site.
  • Whether a remote directory was already visible.
  • The full remote path, if the message names one.

Change one thing at a time, then retry the same file. If you change the port, the username, and the folder mode together, you will not know which change mattered.

Permission denied

What it looks like. The session is already open. A copy, rename, delete, or directory open fails with “Permission denied.” SFTP often adds error code 3, which is the protocol’s permission-denied status. You may also see “Copying files failed” or “path not allowed” when the server confines the account to a directory and the path is outside it.

What it means. The server understood the request and refused it for this account and this path. WinSCP delivered the request. It cannot override the server.

Likely causes. The file mode does not grant your user or group the needed read, write, or execute bit. A directory is missing the execute bit, so you cannot enter it. The directory is owned by another account. The SFTP service is chrooted and the path is outside the jail. SELinux or a similar policy blocks the write even when the Unix mode looks open. The disk quota is full, which some servers report poorly.

  1. Read the path in the message

    Compare it with the folder you think you opened. A home directory and a web root are different paths. Browse to a folder you know you can list, such as the home directory that appeared at login.

  2. Inspect properties if the parent lets you

    Right-click the file or the parent folder and open Properties. Note the owner, the group, and the mode. You need write on a file to replace it, and write plus execute on a directory to create a file inside it. If Properties itself is refused, you cannot see the mode with this account. That fact belongs in the note you send the administrator.

  3. Ask for the smallest change that fits the task

    The administrator can add your user to the existing group, move the upload to a directory you own, or adjust the mode for the owner and group only. Give them the path and whether you need to read, write, or enter. Do not ask for mode 777. That grants every account on the server read, write, and execute, and it is a common source of later incidents.

  4. Retry one file

    Upload a small test file into the directory the administrator named. The remote panel should show it, with the same size. Then delete the test file if you do not need it. A success on the test file and a failure on the original file means the original path is still restricted.

Other ways through. Connect as the account that already owns the directory, if you are allowed to have that account. Logging in as root, or wiring sudo to the SFTP binary, is an administrative change on the server. WinSCP cannot run su after the session starts. The project’s FAQ on changing user is explicit: start as the correct user. A passwordless sudo rule for all commands is broader than a file upload requires. If someone proposes it, restrict it to the SFTP server path or, better, use a group.

When to involve the administrator. When you are not the owner, when the path is outside a chroot, or when the mode already shows group write and you are supposedly in that group. Those are server facts you cannot see completely from a refused client.

Access denied

What it looks like. The message appears while WinSCP is still trying to log in. No remote file list is on screen. The wording is often “Access denied,” sometimes after several authentication methods.

What it means. The server rejected the credentials or the method. This is not the same message as permission denied on a file you can already see.

Likely causes. Wrong username, wrong password, wrong private key, a key that is not in authorized_keys, a server that allows keys only, an account that is locked, or keyboard-interactive authentication that was cancelled.

  1. Re-type the username

    User names are case-sensitive on most SSH servers. Compare the site’s User name field with the account the host created. An email address is not the SSH user unless the host said it was.

  2. Separate password login from key login

    If the account uses a password, clear the private-key field for a test so WinSCP is not offering a key the server rejects first. If the account uses a key, set Advanced, SSH, Authentication, to the .ppk file and leave the password empty. Offering both at random makes the error harder to read.

  3. Confirm the public key is the pair of that private key

    A .ppk from another project will not match the line in authorized_keys. Have the administrator check the key comment or fingerprint for that user. Permissions on ~/.ssh that are too loose cause OpenSSH to ignore the file. The administrator should tighten them so only the user can write the directory. Widening them to 777 makes the ignore behavior worse, not better.

  4. Try once more and stop

    A few failures can lock the account or trip a firewall rule that blocks your address. If the same access-denied message remains, wait and ask the administrator which method the account is allowed to use. Do not keep guessing passwords.

How you know it is fixed. The remote directory opens, and WinSCP does not return to the password prompt.

Connection refused

What it looks like. WinSCP reports that the connection was refused. It happens quickly. There is no password prompt and no host-key prompt.

What it means. The computer at that address answered, and nothing accepted a TCP connection on that port. The operating system refused it. Authentication never started.

Likely causes. The SSH or FTP service is stopped. The port in the site is not the port the service uses. A firewall rejected the port. You chose SFTP on 22, and the host only runs FTPS on 21 or 990. You typed the right name and the wrong protocol.

  1. Read the port next to the protocol

    SFTP is usually 22, explicit FTPS usually 21, implicit FTPS often 990, WebDAV usually 80 or 443. These are defaults, not promises. Set the port from the host’s instructions. A mismatch here is the most common refusal after a fresh install of the client.

  2. Check that the service is the one you selected

    Use the protocol guide to align File protocol with the host’s word. Selecting SFTP against an FTPS-only listener produces a refusal or an immediate close, not a password error.

  3. Ask whether the service is running and allowed from your network

    The administrator can check the listener and the firewall. You cannot fix a stopped sshd from the Login dialog. Trying another client on the same port will fail the same way if the port is closed.

How you know it is fixed. The error changes to a host-key prompt, a certificate prompt, or a password prompt. That means something accepted the TCP connection. Only then do credentials matter.

Connection timed out

What it looks like. WinSCP waits, then reports a timeout. “Host is not communicating” and “searching for host” are related wordings. Nothing refused the connection quickly. The packets did not complete.

What it means. The path to that address and port did not produce a finished handshake in time. Raising the timeout rarely helps if a firewall is dropping the packets.

Likely causes. Wrong IP address, a hostname that points somewhere else, a firewall that drops the port instead of refusing it, a routing problem, a server that is off, or an office proxy that the site does not use. A captive portal on guest Wi-Fi can also black-hole unfamiliar ports.

  1. Confirm the host name

    A single mistyped character sends you to an address that never answers. Compare the field with the host’s dashboard. If the message says the host does not exist, DNS failed before a connection was even attempted. Fix the name or the DNS server your PC uses. That is not a WinSCP defect.

  2. Test from a different network if you are allowed to

    A timeout on office Wi-Fi and a prompt on a phone hotspot, or the reverse, points at a firewall or proxy on one of those networks. Set the proxy only when that network requires one. See the proxy section.

  3. Ask which port is reachable from the internet

    Some hosts keep SSH on a non-default port or allow it only from certain addresses. You need that fact from the administrator. Scanning random ports is not a troubleshooting step for a server you do not administer, and it can violate the host’s rules.

How you know it is fixed. The wait ends in a host-key, certificate, or password prompt, not in another timeout.

Authentication failed

What it looks like. The TCP connection and, for SSH, the host-key step have already succeeded. The server then rejects the login. WinSCP may list methods it tried.

What it means. You reached the correct service, and the account proof was not accepted. Treat it like access denied. Check the method the server expects. Keyboard-interactive is not the same button as a saved password. A key with a passphrase must be unlocked by you or by Pageant. A scheduled task cannot type a passphrase. That failure belongs to the task account setup, not to a looser host-key setting.

How you know it is fixed. A directory listing appears with the username you intended, which you can confirm in the session or the remote path of the home directory.

Network error

What it looks like. “Network error,” “software caused connection abort,” or a drop in the middle of a transfer that had already started. Sometimes the client says the host is not communicating for 15 seconds.

What it means. The session was established and then the socket closed or stalled. This is different from a refusal at the start.

Likely causes. Wi-Fi loss, a NAT gateway that dropped an idle connection, a server limit on sessions, antivirus inspection of SSH, or a laptop that slept. A 15-second silence can also be a server that stopped answering while a disk or a CPU was saturated.

  1. Reconnect and retry one file

    If a single small file now copies, the earlier failure was a dropped path. Use resume for the large file, described in the transfer guide. Look for a .filepart name and do not publish it.

  2. Keep the machine awake until the queue is empty

    Sleep and lid-close events abort sockets. Finish the queue, then sleep.

  3. If every session dies at the same moment, ask the administrator

    Server-side limits and unstable disks are not settings in the Panels page. Bring the time of the drop and the log. Do not disable the host-key check because a link is unstable. The check is not what closed the socket.

Host key verification failed

What it looks like. WinSCP warns that the host key is unknown, or that it differs from the key stored last time. A related pair of messages says WinSCP could not agree a host-key algorithm or a key-exchange algorithm with the server.

What it means. For a new key, you have not verified this server yet. For a changed key, the server identity is not the one you stored. That happens when an administrator rebuilds the server, and it happens when someone intercepts the connection. The warning is the protection. An algorithm mismatch means the two sides have no algorithm in common. That is a compatibility problem, not a reason to skip identity checking.

  1. If the key is new, compare the fingerprint

    Follow the host-key steps. Continue only on a match. Cancel otherwise.

  2. If the key changed, stop and ask

    Contact the administrator on a channel that is not the SSH session you are doubting. If they confirm a reinstall and give you the new fingerprint, you may accept that new value. If they do not recognize a change, do not connect, and do not send the password.

  3. If the algorithms do not overlap, update the server first

    Old algorithms such as obsolete key-exchange methods are disabled because they are weak. The durable fix is to update the SSH server. If you administer a device that cannot be updated and you accept the risk, the site’s advanced SSH settings can add an algorithm the device still speaks. Do that only for that site, only with the algorithm the vendor documents, and only after you understand you are lowering the bar. Do not paste a list of every legacy algorithm into the default session.

Diagram showing that a host-key fingerprint must match the administrator’s value before Continue is the right choice.
A mismatch means cancel. Updating the stored key is a decision after the administrator confirms the new fingerprint.

File transfer interrupted

What it looks like. The queue shows a failed item. A remote name ending in .filepart may remain. The local file is unchanged if the failure was an upload, or incomplete if the failure was a download.

What it means. The copy did not finish. The partial file is not a successful publish.

  1. Reconnect

    Use the same site. If you cannot, fix the connection error first. Resume will not work without a session.

  2. Transfer the same file again with resume enabled

    SFTP and FTP can continue when the server supports it. SCP in WinSCP cannot resume. If the server refuses resume, delete the incomplete .filepart after you confirm the size is short of the source, then copy again in binary mode.

  3. Compare sizes

    The finished remote size equals the local size. The .filepart name is gone. Open or checksum a file that matters before you replace a production copy.

If the same file fails at the same percentage, the path is blocking a write partway through, or a middlebox is cutting the session. Collect the log and the path for the administrator. Splitting nothing and retrying blindly will reproduce it.

Invalid session settings

What it looks like. WinSCP refuses to open the site and points at the session settings. Common triggers are an empty host name, a port that is not a number from 1 to 65535, a broken session URL, or raw settings that contradict each other.

What to do. Select the site, click Edit if you are not already editing, and read Host name and Port number. Clear a pasted URL that included a password and type the host only. If you used Advanced, Edit Raw Settings, remove the line you added last and try again. Save only when Login is accepted by the dialog. A site that cannot be saved cleanly should not be scheduled in a script.

Received too large SFTP packet

The SFTP channel received text that is not an SFTP packet. The usual cause is a shell startup file that prints a banner, a welcome message, or an echo for every session, including non-interactive ones. WinSCP then tries to parse that text as a packet and fails. The same message can appear if you pointed SFTP at a port that speaks HTTP or another protocol.

Confirm the port really is SSH. If it is, the administrator should silence startup output for non-interactive sessions. On many systems that means guarding .bashrc so it returns early when the shell is not interactive. The WinSCP requirements page describes this effect. You cannot fix a remote .bashrc by changing a checkbox if you cannot log in at all. The administrator has to edit it from a console that still works.

Fixes that make the problem worse

  • Setting directories to mode 777.
  • Accepting a new host key you cannot trace.
  • Turning off TLS certificate checks for FTPS because the name does not match. Fix the name or the certificate.
  • Switching to plain FTP so the prompt goes away. You have removed encryption, not fixed the server.
  • Sharing a log that contains a session URL with a password still embedded in it.

FAQ

What is error code 3?

In SFTP it is permission denied. Use the permission denied steps. It is not a Windows error 3, and reinstalling WinSCP does not change the server’s answer.

Why does a second client fail the same way?

Because the failure is on the server or the network. Another client is a useful comparison only after you have matched the protocol and port exactly. If both are refused on port 22, the listener is the problem.

Can this website fix the server for me?

No. The contact form is for corrections to these articles and for privacy requests. It is not a remote support session, and it is not WinSCP product support. Server changes have to be made by someone with access to that server.

Previous: AutomationNext: Alternatives

Sources