Remote File Editing Via SFTP on Linux and Windows for Scite

Originally published: 12/2006 by J Wynia

A couple of days ago, I mentioned that I was giving Scite (and some accompanying scripts) a whirl to see if I could improve over my current default text editor: PSPad.

One of the features I use fairly heavily in PSPad and EditPlus before it is the ability to edit remote files. Both of those products edit remote files via FTP. As Scite doesn't have that feature out of the box, I went looking for a decent solution that would let me fill in that gap for Scite.

I knew of lots solutions for Linux (meaning I'd heard some random geek mention them at some random point) that allow any tool to treat remote files as though they were local, so I went looking for those first.

Since I was dealing with Linux, I figured that SSH was actually a likely method of delivery. That also afforded an opportunity to improve the security at the same time.

The aptly named "sshfs" (SSH filesystem) lets you mount any filesystem you can get to via SSH as though it were local. Wanting nice orderly instructions, I looked for the specific setup for Ubuntu and found this article that I'll be applying to my Ubuntu VMWare instance.

Next up was seeing if I could do the same thing on Windows. I saw lots of mentions of Novell's Netdrive. Most of them amounted to:

"Find some university that bought a site license, and mooch a copy off of an FTP server that they left publically open"

That, combined with the fact that past experiences with NetDrive have been less than stellar.

Mixed in with those results were mentions of WebDrive, which costs $55. It gets a lot of positive attention, but, as I'll likely be needing to apply this on at least 2 Windows workstations, possibly 3, that cost adds up quickly.

Then, I ran across SFTP Drive which, while still $39, also includes 3GB of storage on their servers and comes with a 6 weeek trial. So, I'm going to give that trial a spin.

So far, I'm impressed most with the speed and responsiveness. I'm used to SFTP being much slower than FTP in tools like Filezilla, so I wasn't expecting anything quick. However, it's pretty much as fast so far as any other network drive. I haven't tried it with anything really large, mostly just PHP scripts and properties files.

I think that this might be the solution that will work for me. Nearly every machine that I need to edit files on already runs SSH and the Windows machines that don't can be easily brought up to speed with this SFTP server.

Combine that with Hamachi VPN and I can lock down most of the firewalls and still edit the files I need from any of my workstations. Overall, a pretty good situation.

Comments

Roy on 12/20/2006
On the Linux side, if you use KDE, you probably already have the sftp:// kioslave. Just enter 'sftp://user@site/path/to/directory' in Konqueror's address bar. This works even better when you use ssh-agent to hold your keys in memory. (KDE automatically starts ssh-agent for your session. All you need do is use 'ssh-add' from a terminal window to input your passphrase) I use this all the time to work on my website. sshfs is nifty, as well, if you plan to do command-line stuff, but the sftp ioslave handles probably 95% of my remote editing needs. Both methods handle UID mapping, so the files land on the remote end with the permissions of the login user.
J Wynia on 12/20/2006
Thanks for the tip. I haven't used KDE in quite a while, but it's good to know and helpful for those running other Linux distros. Also very cool about the automatic UID mapping. I had hoped it worked that way, but hadn't tested it.
Rene on 12/26/2006
try jedit, it has a plugin for editing files via ftp or sftp, and it works on linux, mac and windows
J Wynia on 12/27/2006
I've used jedit and didn't really like it. There was something about it that just didn't match how I work. Scite with snippet support is really meshing nicely though.
Gabe on 1/11/2007
I just started checking out Scite, as I tend to check out a lot of text editors, and the ability to edit via ftp is necessary for me. Unfortunately, my work is not interested in buying additional tools for remote editing (we work from windows systems). I have been using Xemacs, which allows you to edit via ftp using: Ctrl-x Ctrl-f /user@host:/path/to/file/name.txt Scite looks like a good tool. Too bad there isn't that ftp support yet. Hopefully some day. Cheers, Gabe
J Wynia on 1/11/2007
Yeah. I'd really prefer something on Windows that is free, but I do think I prefer the system-wide mounting of remote filesystems to having it integrated into your editor. For one thing, I'm REALLY sick of setting up the same server connection settings for my servers over and over again in every one of these tools. If I can just connect at the OS level and every app just uses that site as a drive letter, it doesn't matter what text editor I use and I can switch around as necessary. While I'm probably going to buy this tool, I'm not going to stop looking for other solutions.
Josh Trutwin on 1/24/2007
Hey J, nice seeing your blog (remember me from Bankers?) I stumbled onto this looking for good linux editors with SFTP support to replace my favorite Windows editor Epic, er, I mean UltraEdit/UltraStudio. Thanks for the article, hope all is well.
Paolo on 5/25/2007
hey Roy, i've found the problem: i didn't install all the kde libraries so kate wasn't able to open sftp connections. Now it's all ok, both via ftp and sftp and both with gnome and kde! wonderful. thanks
Yuji on 6/18/2007
If you want an even better alternative Bluefish 1.0.7 has great syntax highlighting. I like it a wee bit more than the Kate or anything else. I use editplus in da windows world. But i kinda like this option better. Using Ubuntu 7.04 with Bluefish 1.0.7.
Yuji on 6/18/2007
Oh yes for the remote option just follow Roy's suggestion to use sftp://ftp.domainname.com only works on port 22 just remember when trying to connect ssh to a windows box with port 22 closed.
thet on 7/3/2007
really great, that saves much time for me! now i can use jedit to edit any file on the remote system! better than using the console. i just googled for remote file editing on linux and landed here (resp. http://www.wynia.org/wordpress/2006/12/19/remote-file-editing-via-sftp-on-linux-and-windows-for-scite/)!
Stephen on 3/6/2007
You can use winscp to do remote editing over ssh
Paolo on 5/22/2007
to ROY: i've tried with Kubuntu, but konqueror doesn't work as you say. On Ubuntu i use the "connect to server" tool to mount a remote file sistem in both ftp and sftp and i can edit all files with kate editor, but in kde i don't know how to "connect to server" in the same way. i'm still studing a solution...
I Hsu on 4/14/2007
WinSCP is a great tool. Thanks, Stephen. I'm giving it a whirl and it's working smoothly to edit css and php files over SFTP. I'm using the Scite text editor and I like the editor, so I'm glad that that there is a Windows SFTP remote file editing solution. On my Mac, I use FUGU for SFTP remote editing. It's pretty good in terms of remote editing. FUGU doesn't allow multiple file transfers and it's quirky on the standard FTP duties, but those issues are tolerable.
Roy on 6/19/2007
I *think* you can use sftp://ftp.domain.com:port for that case. Can't check that just now because I don't have a machine with a non-standard SSH port available, but since that notation works for HTTP and FTP, it makes sense that it works for all the kioslaves.
Paolo on 5/21/2007
On windows i use PSPad for ftp support and winscp with an external editor (usually Notepadd++) for the sftp support. On linux I'm still searching for the right editor to get in one tool both ftp and sftp support. On ubuntu i still haven't found an editor which gives me both functions.
Roy on 5/21/2007
Paolo, if you're a KDE user, you have everything you need already. Konqueror can do ftp and sftp sessions (sftp://sitename/). A simple right-click and you can open your files in Kate or Kwrite and everything is transparent. I believe Gnome/Nautilus can do the same things, but I don't have as much experience with it.
Roy on 5/22/2007
Paolo: I'm not sure what the problem is. I do this all the time with my Kubuntu system. You do need to make use of the ssh-agent to hold your identities in memory. ('ssh-add' from a shell will add in ~/.ssh/id_dsa automatically, and you can specify other key files to be brought in) Then enter the sftp:// "url" in Konq's address bar. Once you have a connection, click over to the network connections tab on the left-hand tree view and drag the address bar in to make a bookmark.
blog comments powered by Disqus
Or, browse the archives.
© 2003- 2014 J Wynia. Very Few Rights Reserved. This article is licensed under the terms of the Creative Commons Attribution License. Quoted content or content included from others is not subject to that license and defaults to normal copyright.