0

I have a web server and I mount the directory containing all my website projects onto a local directory in my Linux VirtualBox under /home/UserA/Desktop/Remote/sites.

My problem is editing the files in the mounted directory. Using Sublime-3, I edit a file and attempt to save but I get a permission denied message.

As it's permissions problem, I attempt to start sublime from a terminal using SUDO or the root user account. However, when sublime starts and I browse to find a file, the mounted directory is not visible to the root user.

My strategy to solve this problem is grant 777 permissions to the mounted sites directory but I actually get permission denied messages for the root user - I thought the root user can go, see and do anything.

I would appreciate some help. I'm really stuck.

UPDATE:

The /home/UserA/Desktop/Remote directory belongs to UserA

The /home/UserA/Desktop/Remote/sites directory, and everything beneath, belongs to root

I am mounting using SSHFS.

  • Are the uid's for the user you're doing things as on the client and the user that owns the files on the server the same? – John Dec 16 '14 at 18:26
  • I added a quick update to answer your question – sisko Dec 16 '14 at 18:33
0

You didn't say how you were mounting this directory, but since you mentioned VirtualBox, I'm assuming that this is a shared folder between the host system and the virtual machine.

Bring up the VirtualBox manager, edit the machine in question, and go to the 'Shared Folders' tab. Make sure that the shared folder has full access (Read-Only is not checked).

Otherwise, if this is an NFS mount, make sure the exporting system is exporting it read-write.

It doesn't matter how much privilege you have on your system if the system providing the data doesn't allow writes.

added info

Since it's using sshfs, everything is done on the exporting system as UserA. Perhaps UserA doesn't have permissions to modify items owned by root. Make sure you can log in as UserA yourself, and change items on that system that is exporting the file system.

Being root on the remote (mounting) system does not confer any privilege to accessing files owned by root on the source (exporting) system. Everything is done on that system as UserA.

  • Apologies Mark. I'm mounting via SSHFS. I added a bit more information to my question – sisko Dec 16 '14 at 18:34
  • The source was recreated from a zip file backup of a lot of websites. All those files show the owner and group as root. I'm sure that's not correct and is likely the reason for the complications when I remotely mount those files for editing – sisko Dec 16 '14 at 19:52
  • @sisko - that would be the cause. Unzip it as UserA, or become root and chown them to UserA. Now mounting via sshfs as UserA will allow those files to be edited. – unpythonic Dec 16 '14 at 21:31
  • Thanks Mark. It was as suspected. once unzipped as UserA I was able to edit and save the files as they were all owned by UserA – sisko Dec 17 '14 at 23:16

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.