DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk10 min

Why SCP Fails When SSH Works and How to Fix It

SSH success proves authentication, not file-transfer readiness. Learn how to identify SCP mode, read verbose output, fix SFTP or remote scp requirements, resolve paths and quoting, and correct permissions.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A successful ssh user@host test proves that the network connection, host-key check and authentication path work. It does not prove that a file transfer can start. scp must additionally start a transfer protocol, resolve and parse both paths, find required server-side components, and pass read, write and directory-traversal permission checks.

Start by identifying the transfer mode. OpenSSH 9.0 and later use SFTP by default; add -O only to request the older SCP/rcp protocol. Then run the same transfer with -vvv, use an absolute path, quote names containing spaces or shell metacharacters, and test the relevant permissions. The failing layer in the diagnostic output normally points directly to the fix.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What a working SSH login actually proves

When ssh user@host opens a session, the client has reached the server, completed key exchange, accepted the host key (or otherwise passed host-key policy), and authenticated the account. Those are necessary conditions for scp, but they are only the transport and authentication part of the job.

A transfer adds several independent requirements:

  • The client must start either the SFTP subsystem or the legacy remote scp program.
  • The source and destination must be parsed as the intended local path and remote user@host:path specification.
  • The path must exist, and every directory in the path must be the expected type.
  • The account must be able to read the source, write the destination, and traverse every parent directory.
  • Shell quoting, wildcard expansion and home-directory syntax must match the selected protocol.

Consequently, an interactive shell can work while a transfer fails with Connection closed, No such file or directory, Permission denied or command not found. Treat those messages as evidence about a second layer, not as proof that SSH authentication has failed.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Check which SCP protocol your command is using

The mode matters because the two protocols interpret paths and start server-side components differently.

Mode How to select it Server-side requirement Path and wildcard behavior When to use it
SFTP mode Default with current OpenSSH clients (9.0 and later) An enabled SFTP subsystem, normally sftp-server or an equivalent internal subsystem Uses SFTP path operations; it avoids the legacy remote-shell wildcard expansion and its fragile quoting rules. Native ~user expansion is not part of SFTP, although an OpenSSH extension can provide it on supported servers. Preferred when the server supports SFTP.
Legacy SCP/rcp mode scp -O ... A compatible remote scp executable available in the remote account’s PATH Remote shell expansion handles wildcards and is sensitive to quoting and shell metacharacters. Only for a documented compatibility need, such as an older appliance that does not provide a usable SFTP subsystem.

OpenSSH’s current scp manual describes the default operation this way: “scp uses the SFTP protocol over a ssh(1) connection for data transfer, and uses the same authentication and provides the same security as a login session.” That shared authentication does not make the SFTP subsystem, path or permissions automatic.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a layered diagnostic sequence

Run these commands from the same machine, account and directory where the failing transfer occurs. Replace the example host, account and paths with your values.

  1. Confirm the SSH connection with maximum client verbosity:

    ssh -vvv user@host

    If this fails, solve DNS, routing, host-key, account or authentication problems first. If it succeeds, continue; do not assume the transfer path is healthy.

  2. Run the exact copy with maximum verbosity and an explicit absolute destination:

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    scp -vvv ./local-file user@host:/absolute/remote/path/

    Keep the source, destination, port, identity and configuration identical to the command that fails in normal use.

    Rank #2
    Sale
    Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
    • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
    • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
    • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
    • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
    • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
  3. Inspect the remote account’s current directory, legacy binary and destination metadata in one SSH command:

    ssh user@host 'pwd; command -v scp; ls -ld /absolute/remote/path'

    The output tells you whether a relative-path assumption is wrong, whether a legacy scp can be found, and whether the destination exists and is a directory.

  4. For a SFTP-mode failure, test the subsystem independently:

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    sftp -vvv user@host

    A failure while starting SFTP points to the server subsystem configuration rather than to the file’s contents.

  5. For a legacy-mode failure, test the remote program explicitly:

    ssh user@host 'command -v scp; scp -V 2>&1 || true'

    The exact version output varies by implementation, but a missing path or an execution error confirms that -O cannot work until the remote binary is installed or configured.

Read -vvv output by failure layer

Authentication succeeds, then SFTP startup fails

Verbose output may show successful key exchange and authentication followed by an attempt to request the SFTP subsystem and then an immediate close. Check the server’s SSH configuration for an enabled Subsystem sftp entry and verify that the configured sftp-server path exists and is executable. A restricted account, chroot layout or server policy can also prevent the subsystem from starting even though a normal shell is allowed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Correct the server configuration, reload the SSH service using your operating system’s normal service procedure, and retest with sftp -vvv before retrying scp. Do not disable authentication or host-key checks as a workaround.

The output names a missing remote scp

This is the characteristic legacy-mode error. The old protocol asks the remote shell to execute scp; if the executable is absent or outside the non-interactive account’s PATH, the transfer stops after authentication. Install a compatible implementation, correct the account’s non-interactive PATH, or remove -O and use the default SFTP mode if the server supports it.

The OpenSSH project notes that transfer commands are usually installed in the remote system’s PATH, but when they are not, transfers fail. An interactive login profile can hide this problem because it may set a different PATH than the non-interactive command used by scp.

The connection closes immediately with little detail

Use scp -vvv and compare the last successful protocol message with the first error. An immediate close after authentication commonly indicates a rejected subsystem request, a forced command, a chroot or a server-side policy. An immediate close after the remote command is sent in -O mode commonly indicates a missing or incompatible remote scp.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make both paths unambiguous

Use an absolute remote path while troubleshooting

A destination such as reports/out.csv is relative to the remote account’s startup directory, which may differ from the directory shown by an interactive shell. A login shell can also run startup code that changes directories, while the non-interactive process used by scp starts elsewhere. Replace the relative destination with a path beginning at the filesystem root:

scp ./out.csv user@host:/srv/reports/out.csv

Verify it with ssh user@host 'pwd; ls -ld /srv/reports'. Check the final component separately: a path that exists as a regular file cannot be used as a directory destination, and a missing parent directory produces a misleading-looking “No such file” message.

Be cautious with ~ and ~user

Legacy SCP commonly relies on remote-shell expansion, so a quoted or unquoted tilde can behave differently depending on where it is interpreted. SFTP has no native ~user expansion; OpenSSH provides an extension on supported server versions, but it is not universal. During diagnosis, use the account’s absolute home path instead of ~ or ~otheruser.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Prevent a local filename containing a colon from becoming a host specification

scp parses a token containing a colon as a remote specification. A local file named backup:2026.tar can therefore be mistaken for a host called backup. Make the local nature explicit with an absolute or relative path:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
scp ./backup:2026.tar user@host:/srv/archive/

If the local file is in the current directory, the ./ prefix is enough to disambiguate it. Confirm the source with ls -l -- ./backup:2026.tar before copying.

Quote spaces, wildcards and shell metacharacters correctly

There are two parsers to consider: your local shell and, in legacy mode, the remote shell. A space, quote, dollar sign, semicolon, asterisk or question mark can be consumed by one of them before the transfer program sees it.

Situation Safer form Reason
Local filename with spaces scp './Quarter 4.csv' user@host:/srv/incoming/ Local shell passes one source argument.
Remote filename with spaces in SFTP mode scp ./local.csv 'user@host:/srv/Quarter 4.csv' Local shell keeps the complete remote specification together; SFTP receives the path as a path.
Legacy remote wildcard scp -O user@host:'/srv/logs/*.gz' ./logs/ The remote shell performs the wildcard expansion. The outer local quotes prevent the local shell from interpreting it first.
Literal wildcard character Quote or escape it according to the selected mode and shell. Unintended expansion can select multiple files or no files.

Legacy SCP’s remote-shell expansion is especially brittle: nested quotes may be consumed before the remote command runs. SFTP mode avoids that particular wildcard mechanism, so a command copied from an old -O-based script may fail after removing or adding quotes. Test one concrete filename first, then add wildcard logic.

If a command contains shell syntax such as $(), backticks, semicolons or redirection characters, quote the complete remote specification and verify the intended literal name. Do not “fix” a parsing error by disabling security checks; simplify the path instead.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Separate read, write and directory-traversal permissions

SSH authentication answers “who are you?” File transfer authorization asks three different questions:

  • Source readability: the account must have read permission on a file it downloads or on each directory needed to reach it.
  • Destination writability: the account must be allowed to create or replace the uploaded file in the destination directory.
  • Traversal: the account needs execute permission on every parent directory in the path, even when the final file itself has suitable mode bits.

Inspect each component as the transfer account:

ssh user@host 'namei -l /srv/reports/out.csv 2>/dev/null || ls -ld / /srv /srv/reports /srv/reports/out.csv'

For an upload, test directory access without changing data:

ssh user@host 'test -d /srv/reports && test -w /srv/reports && echo writable'

For a download, test readability:

ssh user@host 'test -r /srv/reports/out.csv && echo readable'

Mandatory access controls, ACLs, filesystem quotas and read-only mounts can deny an operation even when ordinary mode bits look permissive. Ask the server administrator to check those controls if the basic tests pass but the copy still returns Permission denied.

Fix the common messages

Message or symptom Likely layer Action
scp: command not found or a remote shell reports that scp is missing Legacy remote program Remove -O and use SFTP mode, or install/configure a compatible remote scp in the non-interactive account’s PATH.
Connection closed after authentication SFTP subsystem, forced command, chroot or policy Run sftp -vvv; inspect Subsystem sftp, the server log and account restrictions.
No such file or directory Path resolution or missing parent Use an absolute path, run pwd and ls -ld remotely, and check whether every parent exists.
Not a directory Destination type mismatch Use ls -ld on the final component; remove a mistaken trailing slash or specify the complete filename.
Permission denied Read, write or traversal authorization Test test -r, test -w and parent-directory execute access as the transfer account; then check ACLs and mandatory controls.
Wildcard matches the wrong files or none Quoting and expansion mode Quote the remote argument, determine whether SFTP or -O is active, and test a literal filename before using a wildcard.
A local file is interpreted as a host Colon in local filename Prefix the source with ./ or use an absolute local path.

Why an OpenSSH upgrade can expose the problem

Since OpenSSH 9.0, the default scp implementation uses SFTP rather than the historical SCP/rcp protocol. The change improves path handling by avoiding remote-shell wildcard expansion, but it also changes how shell metacharacters and ~user paths are interpreted. Scripts written for the old behavior can therefore fail after a client upgrade even though the SSH server and credentials are unchanged.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check the client version with:

ssh -V

Then decide deliberately:

  • Prefer default SFTP mode and rewrite scripts to use explicit absolute paths and SFTP-compatible quoting.
  • Use -O only when an older appliance or documented workflow requires legacy behavior, and verify that the remote scp executable is compatible and in PATH.

Do not add -O merely because a command used to work that way. It can restore compatibility for one device while introducing a dependency on a remote program that is absent elsewhere.

Use connection options without changing the protocol accidentally

The current scp synopsis supports the same SSH connection controls you may already use with ssh:

  • -P port selects a non-default SSH port. The capital letter is significant; lowercase -p preserves file times and modes.
  • -i identity_file selects a private key.
  • -F ssh_config selects an SSH configuration file.
  • -J jump_host connects through a jump host.
  • -O selects legacy SCP instead of default SFTP.
  • -X sftp_option passes an SFTP-specific option when the selected client supports it.

Put host, port, identity and jump-host settings in the same command or SSH configuration used by the successful login. A transfer that silently uses a different host alias, port or key is not testing the same connection.

A practical decision tree

  1. Does ssh -vvv user@host authenticate? If no, fix transport or authentication. If yes, continue.
  2. Is the command using -O? If yes, check the remote scp path and compatibility. If no, test SFTP startup.
  3. Does sftp -vvv user@host start? If no, inspect the SFTP subsystem, chroot and server logs. If yes, continue.
  4. Are both paths absolute and correctly typed? Replace relative paths, ~user and ambiguous names, then verify with pwd and ls -ld.
  5. Are names quoted for the selected mode? Remove accidental local expansion and avoid legacy double-quoting in SFTP mode.
  6. Do permissions pass independently? Test source readability, destination writability and traversal for every parent directory.

When the generic checks are not enough

Collect the exact failing command with secrets removed, the complete scp -vvv output, and the OpenSSH client and server versions. Include whether the command used -O, the operating system, the configured SFTP subsystem, and the literal source and destination paths. Server logs at the time of the attempt can distinguish a rejected subsystem, forced command, chroot failure, authorization denial or filesystem error.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not post private keys, passwords or unredacted host-key material. Redact account names and addresses if necessary, but preserve the protocol messages, option flags and path shape; those details identify the failing layer.

Prevent future SCP failures

  • Use default SFTP mode unless a device documents a legacy requirement.
  • Keep transfer paths absolute in automation.
  • Prefix local filenames that contain a colon with ./.
  • Quote spaces and metacharacters, and test wildcard commands with one known filename.
  • Document the expected SFTP subsystem or remote scp dependency for every server class.
  • Run transfer tests as the actual service account, not only as an administrator.
  • After an OpenSSH upgrade, test scripts that use wildcards, ~user, nested quotes or -O.
  • Keep a verbose diagnostic command ready, but do not leave unnecessary debug output or weakened host-key policy in production automation.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.