My user has a home directory


I want her to be able to edit files in:


So I put symbolic links in her directory so like this:

sudo ln /home/user2/file.php /home/user1/file.php

This worked for me when I tested it by logging in as her and nano file.php was able to edit it. The problem is that she uses winSCP to open and edit files. This replaces the symbolic link with a copy of the file, so she can open and edit it, but when she saves it, it loses it's qualities as a link. What's the best way around this?

  • What protocol is she using? Can you show us a log file showing the edit? Does she use an internal or an external editor in WinSCP? How large is the file? – Martin Prikryl Apr 21 '16 at 5:49

First off, not sure if it's a typo but the command you typed in your post creates a hard link, not a symbolic link. If it isn't a typo, the first thing you should try is adding the -s flag to make symbolic links and give it another shot.

Sounds like a bug in WinSCP itself. That's not how symlinks (or hard links) should be handled and I doubt there's anything you can change on the server to coax WinSCP into behaving correctly.

As a temporary fix you could try swapping your symbolic links for hard links if you can. WinSCP shouldn't be able to mess that up. Here's an answer from stackoverflow explaining the differences. The important bit here is that hard links can't span filesystems, so if yours do then you're out of luck here.

Since this is probably a bug, you should submit a bug report so that the WinSCP devs know about it and can fix it in later versions.

If you can't use hard links, and you can't wait for the bug to be fixed, or if it turns out it's not a bug or won't be fixed, then you should tell your friend to find another program if she can. Maybe scp under cygwin, or if she has Windows 10 and is set up for Insider Previews she could try the new linux subsystem out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.