October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Copy Files From One Linux Server to Another

A practical guide to transferring Linux files between servers with scp, rsync, and SFTP, including directory layouts, dry runs, SSH keys, permissions, and troubleshooting.
Length11 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a one-time transfer, use scp. For recurring copies, backups, or a large directory tree, use rsync over SSH. Use sftp when you need to browse a server and choose files interactively. All three require network reachability, an account that can log in to the destination, read permission on the source, and write permission on the destination.

The examples below use server-a for the source, server-b for the destination, and user for the account. Replace those names and paths with your own values, and verify permissions before moving live game saves, configuration files, or other server data.

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.

Choose the right transfer method

The practical choice depends on whether you are making a single copy, maintaining a synchronized tree, or working interactively. OpenSSH documentation describes scp simply: “scp copies files between hosts on a network.” The rsync manual calls rsync “a fast and extraordinarily versatile file copying tool.”

Method Best for What it does well Main limitation
scp A straightforward, one-off file or directory copy Short commands and the same SSH authentication used for a normal login It normally sends the selected data again on each run; it is not a synchronization planner
rsync over SSH Repeat transfers, backups, deployments, and large directory trees Delta transfers, progress display, partial-file retention, and optional metadata preservation Its archive behavior depends on permissions and filesystem support; one local rsync process cannot arbitrarily copy between two remote hosts
sftp Interactive browsing and selecting several files A shell-like session with commands such as put and remote permission changes with chmod Less convenient than one scp command for a scripted copy and less specialized than rsync for mirroring

All of these tools use SSH-based access patterns. A successful SSH login proves that authentication worked; it does not prove that the account can write the target directory or preserve every requested piece of metadata.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

Prepare both servers before copying

Confirm network access and the destination path

Resolve the destination hostname or use an address that the source can reach. Then check the account, directory, and write access in one SSH command:

ssh user@server-b 'id && test -d /remote/path && test -w /remote/path'

A successful command produces the account identity and exits successfully only when /remote/path exists and is writable. If the directory does not exist, create it through an approved administrative process or choose an existing directory; do not assume that a login account may create directories anywhere on the filesystem.

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

Check that the source is readable

ls -l /source/path

For a directory, inspect the directory itself and any files that must be copied. Read access to a parent directory, file ownership, access-control rules, and special filesystem mounts can all affect the result.

Plan around live files

If a game server or another service is actively writing a save, database, log, or configuration file, stop or quiesce that service before copying when consistency matters. A transfer can faithfully copy bytes that are changing underneath it without producing a usable application state. Resume the service only after the destination copy has been checked.

Decide whether metadata matters

Plain file content may be enough for a downloaded save or an archive. Executable deployments, service directories, and permission-sensitive game data may also need timestamps, symbolic links, modes, owners, or groups. Rsync can request those attributes, but the destination account, filesystem, and operating-system policy still determine what can actually be applied.

Copy a file once with scp

scp uses the SFTP protocol over an SSH connection and the same authentication and security as an SSH login. The simplest direction is from the machine where you run the command to the destination server.

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

Local file to the other server

scp /local/path/file user@server-b:/remote/path/

The final slash indicates the destination directory. The account must be able to create the resulting file there. To make the remote filename explicit, use a complete target path such as user@server-b:/remote/path/file.

Copy a directory recursively

scp -r /local/path/directory user@server-b:/remote/path/

The -r option is required for a directory tree. This copies the directory and its contents under the destination path. Check the resulting layout before starting a service: a source named directory will commonly appear as /remote/path/directory, not as the contents directly in /remote/path.

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

Copy from the other server to this machine

scp user@server-a:/remote/path/file /local/path/

This reverses the direction. You still need read permission on the remote file and write permission in the local destination directory.

Use a particular SSH identity

scp -i /path/to/key /local/path/file user@server-b:/remote/path/

The identity file must be readable by the intended user and should be protected from other local users. If the key has a passphrase, enter it when prompted or use an approved SSH agent or secret-management process rather than placing the passphrase in a script.

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

When scp is the better choice

  • You are moving one file or one directory once.
  • The command needs to be easy to read and audit.
  • You do not need a dry run, delta calculation, or a carefully controlled mirror.
  • The destination layout is already known and the account has the required permissions.

For repeated runs, scp generally has to examine and send the selected data again. That is the point at which rsync usually becomes more useful.

Synchronize trees with rsync over SSH

Rsync can copy to or from another host through a remote shell. Its delta-transfer algorithm sends only differences between source and destination, which is valuable for recurring backups, server migrations, and large game-data trees in which only a few files change between runs.

A first local-to-remote synchronization

rsync -avP /local/path/ user@server-b:/remote/path/

Here, -a requests archive behavior, -v increases the visible output, and -P combines progress reporting with retention of partial files. The trailing slash on /local/path/ is significant: it means “copy the contents of this directory.”

Understand the trailing slash

Source expression Typical result under /remote/path/ Use it when
/source/ The contents of source are placed in /remote/path/ The destination directory should receive the files inside the source directory
/source The source directory itself is generally created under /remote/path/ You want a new /remote/path/source directory containing the tree

Because a missing slash can produce a different layout, perform a dry run whenever the destination already contains important data.

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

Preview changes without writing

rsync -avP --dry-run /local/path/ user@server-b:/remote/path/

A dry run lists the operations rsync would perform but does not copy them. Review additions, deletions (when deletion options are introduced), and path names before running the real command. The command shown does not request deletion, so files already present at the destination are not automatically removed merely because they are absent from the source.

Pull data from server-a

rsync -avP user@server-a:/remote/path/ /local/path/

This runs rsync locally and reads the remote source over SSH. The local account needs write access to /local/path/.

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

What archive mode can and cannot preserve

Archive mode asks rsync to preserve the metadata covered by its archive behavior, including the attributes that the invoking account and destination filesystem permit. Ownership and group changes commonly require elevated privileges; a non-root account may copy the file content and mode while being unable to assign the original owner or group. Symbolic links, devices, and special files also depend on filesystem support and policy. Treat the command’s successful exit as evidence that the requested operations completed, not as a guarantee that every attribute became identical.

Why rsync is efficient for repeat jobs

On a later run, rsync compares source and destination and transfers changed portions rather than blindly retransmitting every unchanged file. The progress and partial-file behavior from -P is useful over a slow or interruption-prone link: an interrupted transfer can retain partial data for a later attempt. Confirm your operational and security policies before retaining partial files on a shared destination.

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

Copy between two remote servers: understand the rsync limitation

The rsync manual states that rsync copies to or from a remote host or locally; it does not support arbitrary copying between two remote hosts from one local rsync process. Therefore, a command that names both server-a: and server-b: is not a general remote-to-remote operation that you can expect to work from your workstation.

Run the transfer from one endpoint

If server-a can authenticate to server-b and has the required permissions, start rsync on server-a through SSH:

ssh user@server-a 'rsync -avP /remote/path/ user@server-b:/remote/path/'

In this design, the rsync process that reads the source runs on server-a. The source account must be able to connect onward to server-b, and the destination account must be able to write the target directory. Configure and test that second SSH hop before scheduling the command.

Use a staging machine

When the servers cannot connect directly, copy from server-a to a local or controlled staging directory, then copy that staged tree to server-b. This costs an extra storage location and transfer but keeps each SSH connection simple and makes it easier to inspect the intermediate data.

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.

Check the topology before automation

  • Can the machine that runs rsync resolve and reach the destination hostname?
  • Does the source account have a usable authentication method for the second hop?
  • Are both source reads and destination writes allowed?
  • Is there enough temporary space if staging is required?

Use SFTP for an interactive session

SFTP is useful when you want to browse, transfer a few selected files, and make decisions as you go. Start a session against the destination:

sftp user@server-b

At the sftp> prompt, upload one file, upload a directory recursively, and leave the session as follows:

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
sftp> put /local/path/file /remote/path/file
sftp> put -r /local/path/directory /remote/path/
sftp> exit

Use the session’s directory-navigation commands to inspect the remote location before uploading. The SFTP manual documents an interactive copy oldpath newpath command and remote permission changes with chmod; use those only when the account is authorized to alter the target mode.

When SFTP is preferable

  • You need to transfer several unrelated files selected during a maintenance session.
  • You want to inspect remote directories between uploads.
  • You need interactive commands rather than a single scripted operation.

For a reproducible deployment or nightly synchronization, keep the operation in an rsync command or script instead of relying on a manually typed SFTP session.

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

Set up key-based authentication for repeat transfers

Typing a password for every scheduled copy is both inconvenient and difficult to automate safely. Use a dedicated destination account with only the permissions required for the transfer, then install a public key for that account.

  1. On the machine that will initiate transfers, create or select an SSH key according to your organization’s policy. Keep the private key readable only by its intended user.

  2. Install the public key in the destination account with:

    ssh-copy-id user@server-b

    The ssh-copy-id manual describes this as installing the key in the remote account’s authorized_keys file so key-based access can be used afterward.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  3. Test the login explicitly:

    ssh user@server-b 'id'
  4. Run the intended scp, rsync, or sftp command and confirm that it uses the expected account and destination.

Protect a passphrase-protected private key through an SSH agent or an approved secret-management process. Do not put private keys, passphrases, or unrestricted administrative credentials in a game-server script or world-readable backup.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Permissions, ownership, and common failures

“Permission denied” at the destination

Re-run the preflight test against the exact directory:

ssh user@server-b 'id && test -d /remote/path && test -w /remote/path'

If it fails, use a directory owned by the account, request an administrator to create and grant the required path, or transfer to a permitted staging directory and perform an approved move afterward. Do not solve a narrow transfer by granting broad write access to an entire filesystem.

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.

The source cannot be read

Check the source path with ls -l and verify every parent directory. A service account may be able to run the game but not read a neighboring user’s files, and a mounted volume may not be present in the shell or scheduled-job environment.

The command copied into the wrong directory

Compare the command’s source trailing slash and the destination spelling. With rsync, /source/ and /source intentionally produce different directory layouts. With scp, an explicit destination filename avoids ambiguity.

Files arrive but ownership is wrong

Content transfer and ownership assignment are separate permissions. Archive mode may preserve timestamps and modes while refusing an owner or group change that the destination account is not allowed to make. Have an administrator apply an approved ownership change, or run the transfer as a suitably restricted account that is authorized to preserve it.

The transfer stops partway through

For rsync, -P keeps partial files and shows progress, allowing a later run to continue efficiently. For scp or SFTP, rerun the operation after checking available space and connectivity; verify the final file size and, where your operational process supports it, a checksum generated independently on both ends.

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

SSH login works but the copy fails

Login and file access are different checks. Confirm the exact source and destination paths, account, mount availability, disk space, and directory permissions. In a remote-to-remote design, test the second hop from the endpoint that actually runs rsync rather than testing only from your workstation.

Practical workflows for Linux game servers

Move a one-time save or configuration file

  1. Stop the game service or otherwise prevent the file from changing.
  2. Verify that the destination account can write the target directory.
  3. Use scp /srv/game-data/world/save.dat user@server-b:/srv/game-data/world/.
  4. Inspect the destination ownership and mode before restarting the service.

Mirror a large game-data directory after maintenance

  1. Stop or quiesce the service and decide whether the destination should receive the directory’s contents or the directory itself.
  2. Preview with rsync -avP --dry-run /srv/game-data/ user@server-b:/srv/game-data/.
  3. Run the same command without --dry-run after reviewing the paths.
  4. Check logs and application readability on server-b before switching players or traffic to it.

Maintain a recurring backup

Use a dedicated account and key restricted to the needed destination, schedule an rsync command from the machine with the clearest network path, and retain logs of the command output. Decide separately how long to retain old backups; a basic rsync copy mirrors current files but is not, by itself, a versioned backup system.

A safe decision checklist

  • Choose scp for one uncomplicated copy.
  • Choose rsync over SSH for repeat transfers, large trees, delta efficiency, progress, or partial-file retention.
  • Choose SFTP for an interactive session with browsing and selected uploads.
  • Use a trailing slash deliberately with rsync.
  • Use --dry-run before a consequential synchronization.
  • Verify source read and destination write permissions with SSH and local path checks.
  • Remember that rsync does not perform arbitrary remote-to-remote copying from one local process.
  • Use a least-privilege account and protected key for automation.
  • Validate the resulting path, ownership, permissions, and application behavior before declaring the transfer complete.

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 quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
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.