Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm not a vim guy. I'd like to be able to open log files in Sublime Text when in an SSH connection from within Terminal. Is there a way I could do this? I'm thinking there must be a command or something that could copy the file over to a temporary directory in OS X and then open it in Sublime Text, and when I save it, it'll copy back to the original location through SSH; similar to how FileZilla does it.

I'm on Mac OS X MT. The server I SSH into is running Ubuntu. I'm using Terminal.

share|improve this question

3 Answers 3

You might be interested in sshfs. With that package you can mount a remote directory via SSH and use it like a local one:

sshfs user@ubuntu:/var/log /mnt/ubuntu_logs

It works completely transparent and you can use in principle every program which is installed on your local machine.

In order to use sshfs you'll need also a package that provides a Filesystem in Userspace, on OSX it's obviously called OSXFUSE (http://osxfuse.github.com).

You'll find some more information at that answer on SO and the installation procedure seems to be rather standard as two dmg packages are provided at the above linked Github site.

share|improve this answer

Use sshfs ... that way you can access the files on the remote machine as if they were local, in other words using the apps you have locally installed on your Mac.

I have successfully installed it on Snowleopard in the past.

share|improve this answer

You can try something that I've been working on called 'xeno'. It will allow you to open up files/folders in your local editor from within an SSH connection into any editor on your local machine (and automatically synchronize changes to the remote machine). It should work on almost all POSIX systems (I myself use it from OS X to connect to Linux machines and edit files in Sublime Text). It's free and open source. I'd love some feedback.

Basically, it's a Git/SSH mashup written in Python that allows you to edit files and folders on a remote machine in your local editor. You don't have to configure kernel modules, you don't need to have a persistent connection, it's all automatic, and it won't interfere with existing source control because it uses an out-of-worktree Git repository. Because it's built on Git, it's also extremely fast and supports automatic merging of files that might be changing on both ends, unlike SSHFS which will just clobber any files with older timestamps.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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