Remote File Editing Via SFTP on Linux and Windows for Scite
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.


December 20th, 2006 at 5:03 am
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.
December 20th, 2006 at 6:12 am
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.
December 26th, 2006 at 7:02 pm
try jedit, it has a plugin for editing files via ftp or sftp, and it works on linux, mac and windows
December 27th, 2006 at 5:40 am
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.
January 11th, 2007 at 10:06 am
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
January 11th, 2007 at 11:51 am
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.
January 24th, 2007 at 12:10 pm
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.
March 6th, 2007 at 6:07 am
You can use winscp to do remote editing over ssh
April 14th, 2007 at 5:57 pm
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.
May 21st, 2007 at 2:33 pm
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.
May 21st, 2007 at 2:51 pm
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.
May 22nd, 2007 at 4:32 am
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…
May 22nd, 2007 at 9:27 am
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.
May 25th, 2007 at 5:09 am
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
June 18th, 2007 at 7:22 pm
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.
June 18th, 2007 at 7:23 pm
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.
June 19th, 2007 at 5:08 am
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.
July 3rd, 2007 at 8:20 pm
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/)!