1

I am accessing my server (Ubuntu based) from my local Ubuntu using terminal. I would like to open files on the server using my local application (for example, Sublime editor). Could anyone help me in this?

Zanna
  • 69,223
  • 56
  • 216
  • 327
Rajeev Jayaswal
  • 231
  • 2
  • 8
  • ...and what is the problem? – mikewhatever Mar 04 '17 at 09:46
  • I was hasty in answering, but in any case you will need to connect to the server via _sublime text_ and work from there. See this [link](http://stackoverflow.com/questions/15958056/how-to-use-sublime-over-ssh) – George Udosen Mar 04 '17 at 09:53
  • I changed the title of the question. Your general question is how to access the server files as if they are local to your desktop Ubuntu. The way to do this, is to mount your Ubuntu server home directory through SSH. – user4124 Mar 04 '17 at 10:09
  • @mikewhatever, getting following error while trying to open server files using sublime: Unable to load gtk_window_unfullscreen from libgtk-x11-2.0.so Unable to load gtk_widget_modify_bg from libgtk-x11-2.0.so – Rajeev Jayaswal Mar 04 '17 at 10:15
  • 1
    Possible duplicate of [Mount remote directory using SSH](http://askubuntu.com/questions/412477/mount-remote-directory-using-ssh) – David Foerster Mar 07 '17 at 12:57

1 Answers1

2

You can mount your Ubuntu server files to your local Ubuntu installation, and then edit those files with Sublime as if they were local.

The following assumes that you can SSH access to the Ubuntu server.

sudo apt-get install sshfs

This will install the sshfs package.

cd
mkdir ServerFiles/
sshfs myServerUsername@example.com:/home/myServerUsername/ ServerFiles/

Here you create an empty directory in your home folder and the sshfs command will connect it to your server's home directory.

You can now visit the ServerFiles/ directory with Sublime (or any other program) and you have direct access to your server files, locally!

To disconnect when you finish,

cd 
fusermount -u MYSERVERMOUNT/
user4124
  • 8,781
  • 3
  • 31
  • 36
  • Is there no other way like export DISPLAY=:0 and open using local editor ? – Rajeev Jayaswal Mar 04 '17 at 10:14
  • With `export DISPLAY...` you would be running the GUI program on the server (you would need to install the `ubuntu-desktop` package on the server!). If your connection is not particularly fast, then it will not work very well. – user4124 Mar 04 '17 at 10:19