1

I administer a Ubuntu web server running a LAMP stack. I am now trying to mount the file system to a Windows machine over SSH (using win-sshfs). This works as expected.

However, when editing files and saving them, the owner and umask is overwritten. I'm not sure how to prevent this from happening.

For example, before an edit:

-rwxrwxr-x 1 root    dev-ici  5594 Mar  3 12:33 install1.tpl

After an edit over sshfs:

-rw-rw-r-- 1 mririgo mririgo  5595 Aug  7 17:46 install1.tpl

I'm not sure if the problem is stemming from win-sshfs or from an configuration issue on the server.

There may be more information I would need to provide to help track down the exact issue. If so, please leave a comment and I'll gladly provide it.

  • 3
    The problem is in how some programs perform a save. The programs save in a three step process to make it unlikely that you corrupt your original document. A program might save the new version to something like `install1.tpl.tmp`. Then they will delete the `install1.tpl`, and rename the `install1.tpl.tmp` to `install1.tpl`. The save/delete/rename will result in your permissions being lost, and the default permissions for the directory/user to be used instead. – Zoredache Aug 14 '13 at 00:15
  • @Zoredache Yes, that's exactly what I discovered about 20 minutes ago. Sublime Text's atomic save. Turn what you said into an answer and I'll accept it. – Michael Irigoyen Aug 14 '13 at 17:44

1 Answers1

1

You can use -o idmap=XXXX uidfile=FILE gidfile=FILE where the files contain maps between the UID/GIDs for the two boxes.

Or have NSS configured on the Ubuntu box to pull user information from your domain (assuming Active Directory on the Windows side).

Esa Jokinen
  • 46,944
  • 3
  • 83
  • 129
TheFiddlerWins
  • 2,999
  • 1
  • 15
  • 22