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.

  • Brilliant! How will this help to run gedit on server? Without graphical tools installed on the server there is no way to do it. But it is useful to get access to the remote files. And then @Sandro can use nano or vim to edit them. – Danatela Jul 17 '13 at 6:44

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:


  • 3
    Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Kevin Bowen Jul 28 '13 at 2:56

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.

  • Use the following command

    ssh -X user@host

X must be uppercase, which denotes remote x-server

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy