0

I mounted a remote server's drive through Nautilus. Login as ubuntu(server account). Local user id is tianhe.

I want to use sublime text CLI command (subl file_to_open) to open files on remote server. But I get Permission denied errors.

tianhe@tianhe-windy:/run/user/1000/gvfs/sftp:host=x.x.x.x/home/ubuntu/test$ subl .
cannot open path of the current working directory: Permission denied

However, I can open and create files through Nautilus, by right click the same remote folder -> Open With Other Application -> Choose Sublime Text.


Directory Permission see from server is:

ubuntu@VM-0-9-ubuntu:~/test$ ll
total 12
drwxrwxr-x 2 ubuntu ubuntu 4096 Jul  4 21:42 ./
drwxr-xr-x 8 ubuntu ubuntu 4096 Jul  4 21:23 ../
-rw-rw-r-- 1 ubuntu ubuntu   16 Jul  4 21:42 haha.txt

Directory Permission see from local is:

tianhe@tianhe-windy:/run/user/1000/gvfs/sftp:host=x.x.x.x/home/ubuntu/test$ ll
total 9
drwxrwxr-x 1 tianhe tianhe 4096 7月   4 21:42 ./
drwxr-xr-x 1 tianhe tianhe 4096 7月   4 21:23 ../
-rw-rw-r-- 1 tianhe tianhe   16 7月   4 21:42 haha.txt
tianhe@tianhe-windy:/run/user/1000/gvfs/sftp:host=x.x.x.x/home/ubuntu/test$ subl .
cannot open path of the current working directory: Permission denied
tianhe@tianhe-windy:/run/user/1000/gvfs/sftp:host=x.x.x.x/home/ubuntu/test$ 

What's wrong and how can I fix it?

  • 1
    I'm not familiar with sublime text, but . usually means the current directory. Isn't the right command subl haha.txt? – pa4080 Jul 4 at 14:42
  • 1
    Can you open files with other programs? E.g. CLI: cat haha.txt or more haha.txt then GUI: gedit haha.txt? – Fiximan Jul 4 at 14:45
  • @pa4080 Yes it's the right command. Open a directory or a file are both correct. – Rick Jul 5 at 0:56
  • @Fiximan Oh I seem to understand something. cat and more are ok. the GUI gedit also works. Now I think the problem is totally because of Sublime Text. – Rick Jul 5 at 0:58
  • I tried VS code and it works. – Rick Jul 5 at 1:02
0

I uninstalled the Sublime Text installed from Ubuntu Software and then reinstalled it according to the offcial doc from its official site, which essentially uses apt. And it works!

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.