This how-to only works on Linux OS and has been tested on a recent Ubuntu release.
In many cases, you have a simple SSH access to edit files on a remote server. Because this is a remote server you can only use remote editors like vi and sometimes emacs. These editors are not so bad but if you are not at your ease using them you can quickly become like this nervous guy.
Maybe you prefer to use one of your local editor like bluefish, gedit or kate. So just do it …
Assume that you have an access with user clebeaupin to the remote server named remote.server.com. To connect, you just have to type this following line in a terminal:
clebeaupin@atalante:~$ ssh clebeaupin@remote.server.com
…
Then if you want to edit a file :
clebeaupin@remote.server.com:~$ vi /etc/httpd/httpd.conf
…
What’s this fucking editor for geek guys ?
If you want to relax and forget vi in the dark side of your brain, just use fuse kernel module with sshfs plugin. Fuse+sshfs allows you to mount on your local filesystem a remote filesystem. To install it, just open a shell and type the following lines:
clebeaupin@atalante:~$ sudo apt-get install sshfs
…
Before mounting a remote filesystem, you must add the fuse group to your user like this:
clebeaupin@atalante:~$ sudo adduser clebeaupin fuse
…
And check that fuse module is loaded at kernel boot:
clebeaupin@atalante:~$ ls -la /dev/fuse
crw-rw—- 1 root fuse 10, 229 2007-09-20 00:46 /dev/fuse
…
If not just add it to /etc/modules file.
Then to make sure everything goes right, just reboot your system.
After re-booting and re-logging, you can mount a remote filesystem on your local computer. For example, if you want to mount all remote filesystem of remote.server.com in the directory /home/clebeaupin/mnt, type this:
clebeaupin@atalante:~$ sshfs clebeaupin@remote.server.com:/ /home/clebeaupin/mnt
…
If you want to restrict the mounted filesystem to a specific directory like /etc, do this:
clebeaupin@atalante:~$ sshfs clebeaupin@remote.server.com:/etc /home/clebeaupin/mnt
…
At this time you can list, view and edit all files of the remote server. You can use all command lines like ls, rm, mkdir and of course gedit in /home/clebeaupin/mnt:
clebeaupin@atalante:~$ gedit /home/clebeaupin/mnt/modules &
…
It works. And if you have enough permissions you can break all config files of the remote server with your favorite editor
jadawin said
vim is life. nothing else
David said
For MacOS X users, you can use MacFuse Project from Google.
follow http://code.google.com/p/macfuse/
julien said
First : to me VI is the editor
Second : I just hope you will not break the config on my remote server
Sportivement
clebeaupin said
Do you know TextMate ? It seems to be a really good editor for MacOs with a lot of various plugins (svn, python, …).