Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Accidentally overwriting configuration files from one server onto another with same name

Thanks for your report. I'm not aware of such problem. Can you provide step by step instructions for reproducing it? It's not clear from your report if the problem happens also with internal editor of WinSCP or only with external editors.
enriluis

Accidentally overwriting configuration files from one server onto another with same name

Subject: WinSCP Overwrites Files with Same Names Across Multiple Servers - Critical Issue

Hello community,

I'm experiencing a serious problem with WinSCP that's causing operational issues and I'm seeking advice on how to prevent it.

The Problem:
When managing multiple Linux servers with WinSCP, I'm accidentally overwriting configuration files from one server onto another. The issue occurs specifically when I edit files that have identical names across different servers. For example:

  1. I connect to Server A and edit /etc/config/server-settings.conf
  2. Later, I connect to Server B and need to edit its /etc/config/server-settings.conf
  3. When saving the file on Server B, WinSCP sometimes transfers the content from Server A's version, effectively overwriting Server B's configuration with Server A's settings

This causes severe service disruptions as each server has unique configurations despite identical filenames.

Current Setup:

  • Multiple Linux servers (different roles, environments)
  • Many configuration files share the same names across servers but contain different contents
  • Using WinSCP's integrated editor or external editors (Notepad++, VS Code)
  • Standard file management workflow: connect → edit → save

What's particularly concerning:
The overwriting happens silently in some cases. I might have Server A's file open in my editor, connect to Server B, and when I save what I *think* is Server B's file, I'm actually writing Server A's content to Server B. WinSCP doesn't always provide clear warnings about this cross-server contamination.

Attempted solutions (with limited success):

  1. Setting overwrite prompts in WinSCP preferences
  2. Using different color schemes per server session
  3. Making files read-only (impractical for frequent edits)
  4. Manual backup before each edit

Questions for the community:

  1. Is this a known WinSCP behavior when using external editors?
  2. What workflow changes or tool configurations can prevent this cross-server file contamination?
  3. Are there plugins, scripts, or alternative tools that handle multi-server file editing more safely?
  4. How do you manage same-named configuration files across multiple servers without risking accidental overwrites?
  5. Should I avoid WinSCP's "Edit" feature entirely for this use case?

I'm looking for practical solutions that don't require completely changing my infrastructure. Any insights from those managing multiple servers would be greatly appreciated.

Thank you for your help.

Technical note: The issue seems related to how WinSCP caches files locally when opened with external editors. If the editor maintains the same filename in its buffer across different server sessions, WinSCP might write that cached content back to the wrong server.