Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk12 min

How to Use SFTP to Transfer Files Securely to Your Server

A practical guide to secure SFTP transfers, including connection syntax, host-key verification, SSH-key authentication, interactive commands, batch automation, integrity checks, and production security practices.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use OpenSSH’s SFTP client when you need to move files through an encrypted, authenticated connection. You connect with the server’s hostname, account, port, and (ideally) an SSH key, verify the server’s host-key fingerprint, then use commands such as put to upload and get to download. For repeatable jobs, place the commands in a batch file and run SFTP with a protected key and a dedicated, least-privileged account.

This guide covers the complete workflow: prerequisites, host-key verification, password and public-key login, interactive transfers, automation, integrity checks, and the most common failure modes.

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 SFTP is and why it is secure

SFTP (SSH File Transfer Protocol) is the file-transfer program shipped with OpenSSH. It performs file operations over an encrypted SSH transport rather than sending a separate, unprotected file-transfer channel. During the SSH connection, the peers negotiate a key-exchange method, authenticate the server with its host key, and select encryption, message-authentication, and optional compression algorithms. The resulting channel is designed to protect both confidentiality and integrity.

That security depends on checking the server identity. Encryption by itself does not prove that you reached the intended machine. On a first connection, compare the fingerprint displayed by your SFTP client with a fingerprint supplied by the server operator through an independent, trusted channel. Investigate an unexpected key change instead of accepting it automatically.

#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.

SFTP is not the same protocol as traditional FTP. It normally uses one SSH connection and the SSH server’s SFTP subsystem. An OpenSSH server can launch the external sftp-server program or provide an internal SFTP subsystem through sshd. If that subsystem is not enabled for your account, a client cannot complete the transfer even when ordinary SSH login works.

Information and access you need before connecting

Collect the following details from the server administrator before you run a command:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Item What to obtain Why it matters
Hostname or IP address The exact DNS name or address This identifies the endpoint to which SFTP will connect.
Username An account permitted to use SFTP Remote paths and permissions are evaluated as this account.
SSH port Port 22 is common, but the administrator may use another port A client pointed at the wrong port may appear to time out or reach a different service.
Remote directory The upload or download path, such as /srv/uploads Knowing the approved directory prevents accidental writes elsewhere.
Host-key fingerprint The fingerprint for the server’s SSH host key, delivered through a trusted channel You need it to authenticate the server on first contact and to investigate later changes.
Authentication method Password, public-key authentication, or another method required by the server Your client options and automation design depend on this choice.
SFTP availability Confirmation that the SSH daemon exposes an SFTP subsystem An account can have SSH access while SFTP is disabled or restricted.

Also confirm that a firewall, VPN, or network allow-list permits your source address to reach the SSH port. Ask whether the account is chrooted or otherwise restricted; in a restricted account, the path shown by SFTP may be relative to a virtual root rather than the server’s filesystem root.

Choose password or SSH-key authentication

Password login

Password authentication is straightforward for an occasional, manual transfer. It is a poor fit for unattended jobs because a scheduled process cannot safely stop and ask a person for a password. Never place a password in a command line, script, ticket, shared document, or shell history.

Public-key login

Public-key authentication uses a key pair: a private key that remains on your computer and a public key installed in the server account’s authorized-key configuration. The server proves that the client possesses the private key without receiving the private key itself. Protect the private key with a strong local passphrase when a human will unlock it, and restrict its permissions so other users cannot read it.

If you need to create a new Ed25519 key on a Unix-like system, an example is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519

Give the resulting public key (the file ending in .pub) to the administrator through the organization’s approved channel. The administrator must install it for the correct account and confirm that the account’s SSH configuration permits public-key authentication. Do not send the private-key file.

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.

For an unattended transfer, use a key created for that job or service account rather than a personal key. Keep it outside source control, back it up according to your organization’s key-management policy, rotate it when staff or systems change, and revoke the corresponding public key when it is no longer needed.

Connect to the server and verify its identity

Basic connection

From a terminal, connect with the account and hostname supplied by the administrator:

sftp [email protected]

If the server listens on a non-default port, use an uppercase -P:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sftp -P 2222 [email protected]

To select a particular private key, use -i:

sftp -i ~/.ssh/id_ed25519 [email protected]

The -i option selects the identity file used for public-key authentication. You can combine the port and key options:

sftp -P 2222 -i ~/.ssh/id_ed25519 [email protected]

First-connection fingerprint check

On a first connection, SSH displays the server host key and its fingerprint and asks whether to continue. Stop and compare that fingerprint with the value obtained independently from the server operator. Accept the key only when the values match. A warning about a changed key on a later connection can indicate a legitimate server rebuild, a changed address, or an active interception attempt; verify the change out of band before replacing the stored key.

Once accepted, the host key is normally recorded in your user’s SSH known-hosts file. That record allows future connections to detect an unexpected change. Do not bypass host-key checking merely to make an automation job run; fix the underlying identity or deployment problem instead.

Specify a destination path at connection time

SFTP accepts a destination in the form [user@]host[:path]. It also accepts a URI-style form, sftp://[user@]host[:port][/path]. For a one-file operation, you can include the remote path directly:

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
sftp [email protected]:/srv/uploads/report.pdf

This opens an SFTP session with the named remote file as the starting destination. You still need permission to access the directory and file.

Use the interactive SFTP prompt

After authentication, the prompt changes to sftp>. SFTP maintains separate local and remote working directories, so use pwd and cd for the server and lpwd and lcd for your computer.

Command Purpose Example
pwd Show the current remote directory pwd
lpwd Show the current local directory lpwd
ls List remote files ls
lls List local files lls
cd Change the remote directory cd /srv/uploads
lcd Change the local directory lcd ~/Documents
put Upload one local file put report.pdf
get Download one remote file get results.csv
put -r Upload a directory recursively put -r project/
get -r Download a directory recursively get -r backups/
mkdir Create a remote directory mkdir archive
rename Rename or move a remote file rename old.csv archive/old.csv
exit or bye Close the session exit

Upload a single file

  1. Connect and complete the host-key check.
  2. Run pwd to see where you are on the server and lpwd to see where the local file will be taken from.
  3. Change directories if necessary, for example cd /srv/uploads and lcd ~/Documents.
  4. List the local directory with lls, then upload with put report.pdf.
  5. Run ls to confirm that the remote name is present, then leave with bye.

Download a file

Change to the remote directory, set the desired local directory with lcd, and run get filename. Use get -r directory/ for a directory tree. Check local free space before downloading a large tree and avoid writing into a directory where an existing file could be silently replaced.

Transfer a directory

put -r project/ recursively uploads the named local directory and its contents. The destination directory must already exist or be creatable by the account, and every nested file must be readable locally and writable remotely. The corresponding download command is get -r backups/.

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.

Automate repeatable uploads with batch mode

Put a deterministic sequence of SFTP commands in a plain-text batch file. For example, save the following as upload.batch:

cd /srv/uploads
put /var/backups/report.pdf
bye

Run it with a key:

sftp -i ~/.ssh/id_ed25519 -b upload.batch [email protected]

OpenSSH’s -b option runs SFTP in batch mode. The process must have a non-interactive authentication path; otherwise it will stop when a password or an interactive confirmation is required. A passphrase-protected key may require an agent or another approved secret-unlocking mechanism, so test the exact runtime environment rather than assuming that a key which works in your terminal will work from a scheduler.

Make the job safe to schedule

  • Use a dedicated account whose permissions are limited to the required upload directory.
  • Use a dedicated key and store the private key outside source control with restrictive filesystem permissions.
  • Use absolute local and remote paths so the result does not depend on a scheduler’s working directory.
  • Capture the command’s exit status and logs. Record the time, account, destination, filename, and success or failure without logging secrets.
  • Test both a successful upload and an intentional failure, such as a missing source file or unwritable destination, before scheduling production runs.
  • Alert on repeated failures, authentication changes, and unexpected host-key changes.

A batch file is not a substitute for validation. Confirm that the source file exists, that its name is the expected one, and that the destination has enough space before a scheduled run. Keep the batch file itself free of passwords and private-key material.

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.

Publish files without exposing partial content

If another process consumes files as soon as they appear, do not upload directly under the final name. Upload under a temporary, deterministic name and rename it only after the transfer succeeds. For example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
cd /srv/uploads
put /var/backups/report.pdf report.pdf.part
rename report.pdf.part report.pdf
bye

Consumers should ignore the temporary suffix. A rename within the same filesystem is the hand-off point at which the final name becomes visible, avoiding a reader opening a partially uploaded file.

Check durability and file integrity

Flush uploaded data when supported

OpenSSH provides an [email protected] extension. The SFTP -f option requests that uploaded files be flushed to disk immediately. This is a request to a server that supports the extension, not a promise that every SFTP implementation will honor it. If durability at the storage layer is critical, confirm the server’s implementation and operational guarantees with its administrator.

Use independent integrity checks

At minimum, compare the expected filename and byte size after the transfer. For workflows that require stronger assurance, calculate a cryptographic hash independently on the source and destination and compare the values through a trusted process. Do not treat a successful network transfer alone as proof that the file is the intended version; a source file can change before it is read, or a downstream process can replace it afterward.

For large or valuable files, record the source hash, transfer timestamp, destination path, and the account used. Keep those records with the job logs so a later audit can distinguish a transfer failure from a post-transfer modification.

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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Security checklist for production SFTP

  • Verify the host key. Obtain the fingerprint independently before the first connection and investigate every unexpected change.
  • Prefer public-key authentication for automation. Protect private keys, rotate them, and remove obsolete public keys from server accounts.
  • Apply least privilege. Use a dedicated account with access only to the required directory and operations. Do not grant an upload job an administrator account.
  • Limit network exposure. Where practical, restrict the SSH port at the firewall to expected source networks, VPN ranges, or transfer hosts.
  • Patch the platform. Keep OpenSSH and the operating system current, and follow the installed release’s guidance for current key-exchange, host-key, encryption, and MAC algorithms.
  • Protect secrets. Never put passwords or private keys in shell history, scripts, tickets, chat, or shared documents.
  • Log and alert. Retain successful and failed transfer events and alert on unexpected authentication or host-key changes.
  • Control filenames. Use a naming convention that prevents accidental overwrites and a temporary-name-then-rename workflow for files consumed automatically.

Understand SFTP’s place among transfer methods

The useful comparison is not just speed. Evaluate how each method encrypts traffic and authenticates the endpoint, how identities and keys are managed, what firewall connections are required, whether unattended automation is practical, how directories and permissions are controlled, and what audit trail is available.

Question SFTP What to verify for any alternative
Is the transfer protected? File operations run over the authenticated, encrypted SSH transport. Identify the protocol’s encryption, integrity protection, and endpoint-authentication mechanism.
How are users authenticated? SSH passwords or public keys, subject to the server’s configuration. Check how credentials are issued, protected, rotated, and revoked.
What network access is needed? Normally one SSH service and port, including a non-default port when configured. Document control and data channels, passive-port ranges, proxies, and firewall rules.
Can it run unattended? Yes, with non-interactive key authentication and batch mode. Confirm that the method can fail safely without embedding a password.
Can access be narrowed? Server accounts can be limited to approved directories and permissions. Check whether the alternative offers equivalent directory and operation controls.
Can activity be audited? SSH and transfer logs can record authentication and file-operation events, depending on server configuration. Verify what is logged, how long it is retained, and whether alerts can be generated.

Troubleshoot common SFTP failures

Connection times out or is refused

Confirm the hostname, port, DNS result, firewall rules, VPN connection, and source-address allow-list. Port 22 is conventional, not guaranteed. Ask the administrator to confirm that the SSH service is listening on the address reachable from your network.

Host-key warning or changed fingerprint

Do not delete the old key and reconnect blindly. Contact the operator through a trusted channel and determine whether the host was rebuilt, moved, or replaced. If the change is legitimate, obtain the new fingerprint and update your known-hosts record according to your organization’s procedure.

Permission denied during authentication

Check the username, selected identity file, private-key permissions, and the server’s authorized-key entry. Ensure that the public key belongs to the private key you selected. If password login is intended, verify that the account permits it and that your client is not being forced to use a different identity.

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

Authentication succeeds but SFTP will not start

The account may be allowed to open SSH sessions but not the SFTP subsystem. Ask the server administrator to check the sshd configuration, the external sftp-server path or internal subsystem, and any per-user restrictions.

Remote path or file is not found

Run pwd and ls to see the remote view presented to your account. A chroot or virtual root can make /srv/uploads on the host appear as a different path inside SFTP. Check capitalization, spaces, and account permissions, and use lcd and lls separately when the local file is missing.

Upload fails partway through

Check available space and quotas at both ends, network stability, file readability, and server logs. Remove or quarantine an incomplete temporary file before retrying. A deterministic temporary name prevents a partial file from being mistaken for a completed one.

Batch mode waits for input or stops unexpectedly

Use a key-based, non-interactive authentication path and ensure that host-key verification has already been handled in the controlled environment. Replace relative paths with absolute paths, inspect the captured exit status and logs, and reproduce the same command as the scheduler’s user before changing the production job.

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

A repeatable transfer procedure

  1. Obtain the hostname, account, port, remote directory, SFTP availability, and trusted host-key fingerprint.
  2. Choose password login for a one-off manual transfer or public-key authentication for repeatable work.
  3. Connect with sftp, supplying -P for a non-default port and -i for a selected key.
  4. Compare the first-connection fingerprint with the independently supplied value before accepting it.
  5. Use pwd, lpwd, cd, and lcd to verify both working directories.
  6. Transfer with put, get, put -r, or get -r as appropriate.
  7. For automated consumers, upload to a temporary name and rename only after completion.
  8. Check the resulting filename and size; compare independent hashes when the workflow requires it.
  9. Close the session, retain useful logs, and review failures or identity changes instead of suppressing them.

Following those steps gives you an encrypted transport, verified server identity, controlled account access, and a transfer process that can be repeated and audited without putting credentials in plain text.

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
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.