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:
- File -> Connect to server
- fill in your ssh/sftp server sftp://email@example.com/folder
- Make Bookmark.
- 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.