Ubuntu: using gedit through ssh connection - should I have gedit installed on the server?


I wanted to try out using graphical tools over ssh. Just to learn a new thing :)

so my understanding is this, I connect like this: ssh -port -x user@server

But I'm running ubuntu server so it has no gui and thus no gui tools. My understanding is I've to install gedit on server. But also xserver?

Can someone clear up this concepts to me?


The correct command is

ssh -p 2222 -X user@host  

where I suppose the server listen on 2222 port number. Also note that the case of X option is important, it must be uppercase.

You need to have the program you want to run installed on the server (gedit in this case). Also you may install gedit without installing X, just because you can run gedit on a remote X server, as you are trying to do.


I think that the question is not about how to use the ssh console command, but some way to use gedit over ssh connections. Well there is a way.. you can mount the remote file system in a local directory through sshfs, then you can use gedit to edit those files, or whatever application running in the local machine to edit the files in the local ssh mapping.


Ok sorry I just realized this question was specifically about X over ssh or that kind of thing. But since I wrote this I will post it anyway. If your not up for just "trying new things" like the question asked and just want to open a file on a ssh server with gedit. I personally would not do it that way. But sometimes I would like to be able to open a file in gedit when I am logging in to my server over ssh. This is how I ended up here. (and I have not found the answer to that here)

ssh means sftp is also available as well. Modern GNU/linux filemanagers support connecting to sftp server and browse and open and edit files just like they are local (but slower over the net usually)

I have a login with a public key setup for security and convenience so I can log into my server over ssh and sftp without a password just by clicking a bookmark I made in nautilus:

  1. File -> Connect to server
  2. fill in your ssh/sftp server sftp://user@
  3. connect.
  4. Make Bookmark.
  5. Double click on files associated with gedit (or anything)

So this is how I do it. I think its called gvfs and its a virtual filesystem that nautilus & co use. You can set it up to automount servers on boot and then have directories available all the time (on the console) if thats needed.


You don't have to install gedit on your server, but you can use gedit on your desktop to edit file on the server. Here is howto:


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »