I use a linux machine at work and a mac at home. I can ssh from my machine at home to my work machine. But the only editor that I have access to on the command line then is vi, which I don't like.

Is there a way to use gedit on my mac to edit files remotely over an ssh connection?

This page says that it can be done, but I think that it assumes that you are using gedit on ubuntu. On my mac (os 10.5.8) I don't have the "bookmark" option when I click "connect to server".



CyberDuck will allow you to edit files over SSH using the Mac text editor of your choice. I recommend TextWrangler.

| improve this answer | |

Use the -X option when you ssh into your linux machine. If you haven't already installed X11, it's available as an optional install on your OS X install disc. With X11 installed, 'ssh -X user@host' starts X11 and you're ready to use gedit.

Alternatively, you can use Macfusion to mount your linux machine, through ssh, as a file system. You can then use an OS X text editor to edit files on the remote machine.

| improve this answer | |
  • Depending on your version of OS X you may need to reinstall X11. I had to on Leopard. – aqua Feb 4 '11 at 4:50
  • 1
    Alternatively, you can use TextWrangler to edit files directly over SSH. – romainl Feb 4 '11 at 10:33
  • +1 for ssh -X. I used that all the time at university. With Leopard and Snow Leopard, I didn't have to reinstall X - it "just worked". – Cajunluke Feb 7 '11 at 22:32
  • 2
    gedit via x11-forwarding? the horror ... sshfs is the only solution that makes any sense. – akira Feb 7 '11 at 23:06
  • Thanks, @romainl, that's actually the best solution IMHO. I've been using TextWrangler for 3 years and never noticed it can do that. – noamtm Jul 9 '13 at 21:39

Gedit uses gvfs, a virtual filesystem layer which allow him to access files through different protocols, including sftp (which is very probably available if ssh is available). So you're likely already able to use it to edit your remote files with no need to install anything. Just type sftp://youserver/ in the open dialog.

You can also use fuse + sshfs to mount the distant file hierarchy to a local mount point, thus be able to use any application to edit any file. An easy way to do this seems to be through MacFusion.

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.