4
1
There is a remote server which I connect to daily through ssh. I do a lot of editing of files on the server, so I use sshfs
to do so.
I mount the directory with $ sshfs user@host:/var/www/html ~/sshfs/html
. This has worked very well over the past few months, and still should work even now. However, I'm having some strangely inconsistent access problems.
Case 1 - Sublime Text: I'm completely unable to save anything using my editor of choice (Sublime Text). I can't Save-As to create a new file in ~/sshfs/html/
either. I can open files, but not save.
Sublime gives the following message in an alert box when trying to save:
Unable to save ~/sshfs/html/foo
Error: rename(/home/ben/sshfs/html/.subl219.tmp, /home/ben/sshfs/html/foo) failed
errno: 1
Case 2 - Kate: I tried opening things in Kate to see if Sublime was just being dumb. I'm still unable to edit existing files, but I can create new files with no problems in Kate.
Kate gives the following message in an alert box when trying to save an edit:
The document could not be saved, as it was not possible to write to /home/ben/sshfs/html/foo.
Check that you have write access to this file or that enough disk space is available.
Case 3 - Vim: Here's where things start making less sense. I tried using Vim on my local machine with
$ vim ~/sshfs/html/foo
Surprisingly, I have no problems at all using Vim. It opens, edits, saves, and creates files without problems. I also have no problems when using shell commands such as touch
.
Things to consider
- Group access
- The group
developers
has access to all files I want to edit. - My local user is a member of the group
developers
. - My remote user (The account I login to via SSH) is a member of the group
developers
. - The group
developers
exists on both the server and my local machine with the same ID.
- The group
- Other things
- I have several directories across a couple of servers that I use like this. None of the other directories on other servers are giving me any trouble.
- Running
$ ls -l
on my local host inside the mount point:
Output
drwxrwxr-x 1 root developers 4096 Sep 8 06:47 admin
drwxrwxr-x 1 root developers 4096 Jun 4 2013 agent_submit
-rwxrwxr-x 1 root developers 6605 Jun 4 2013 authorize.php
- Running
$ ls -l
on the remote host through an ssh shell:
Output
drwxrwxr-x 10 root developers 4096 Sep 8 06:47 admin
drwxrwxr-x 2 root developers 4096 Jun 4 2013 agent_submit
-rwxrwxr-x 1 root developers 6605 Jun 4 2013 authorize.php
What are the permissions of these files (output of
ls -l
) ? Can you edit files via shell commands, such astouch foo
orecho "blah" >> foo
? – Levans – 2013-12-04T20:59:43.560@Levans: I've updated the question with
ls
output. And I have no problems editing or creating via shell commands. – dotVezz – 2013-12-04T21:16:31.710It shouldn't make any difference, but do you get the same behavior if you mount it like
$ sshfs user@host:/var/www/html /home/ben/sshfs/html
? – rickhg12hs – 2013-12-05T04:39:19.913@rickhg12hs no difference. – dotVezz – 2013-12-05T13:12:33.820
Strange, but seems like it's probably
– rickhg12hs – 2013-12-05T14:09:54.323fuse
. Perhaps you could enable debugging and/or extend timeouts to see what's happening. sshfs man page has the switches to try.