PDA

View Full Version : Edit file on remote server with BBEdit


bluehz
02-28-2003, 10:31 AM
I have to edit a lot of XML files on my Linux server on the LAN at my location. I am tired of editing via terminal and I would really like the BBEdit syntax coloring - so I was wondering if there was a way to use the BBEdit FTP function to accomplish this WITHOUT having to run an ftp server on the remote server machine just for that function.

I was playing around with the idea of SSH port forwarding - something like this I saw in an SSH forum:

Most of the files that I edit on my Powerbook reside on a Sun Host befind a
firewall that does not allow insecure traffic (telnet ftp, etc.). To access
them via BBEdit's FTP open remote function I establish an SSH tunnel that
allows me to pipe the FTP through the firewall like:

ssh -L 2025:remote.server.edu:21 remote.server.edu

I can then establish an FTP connection in BBEdit using the local port (of
the tunnel) 127.0.0.1:20

Unfortunately it is not working. Whenever I watch the remote server I see:

channel 2: open failed: connect failed: Connection refused

I also know that MacSFTP allows editing via BBEdit - but not exactly - what it does is copy a file to the local machine, then you edit with BBEdit, and when you save it it transfers it back to the server.

Does anyone know a way to get BBEdit to edit files on remote server?

eravau
02-28-2003, 01:52 PM
Well, you can't use BBEdit to connect via its ftp function...when there's no ftp server there.

So your options are either:
Run an ftp server like you're trying to avoid or
Run netatalk or samba on the Linux box so that you can mount the server locally and edit the files on there.I don't think there's another way.

flimflam
02-28-2003, 02:23 PM
I haven't played with this yet, but I think you're on the right track. A couple of things to keep in mind however:

[list=1]
You need to be root to forward privileged ports (of which 21 is one), so remember to sudo!
In your sample code, you're forwarding local port 2025, and I'm not sure that BBEdit can do FTP on ports other than 21.
[/list=1]

I've actually been meaning to do something like this for a long time, but haven't gotten around to it -- I'll give it a shot and post something here if it works.

flimflam
02-28-2003, 02:28 PM
I just reread your post -- I had missed the part about there not being an FTP server running on the server. This will work only if ftpd is running on the server. It is useful in cases where insecure traffic is not allowed over the link, but the protocols still have to work.

I think that in your case the MacSFTP method is the best one -- if it works the way I think it does it should be pretty transparent.

bluehz
02-28-2003, 05:08 PM
Thx for the replies. Its my server so I can certainly put any type of service on it I want - I just didn't really want to have an ftp server running all the time for simply editing text. Yet I know that sftp works - I use that all the time, I was thinking I could tunnel BBEdit over sftp so I wouldn't have to do any sort of new service.

breen
02-28-2003, 05:23 PM
Instead of tunneling BBEdit (I'm not sure what that would look like anyway) you can install netatalk on your Linux box and tunnel AFP over TCP.

Your ssh invocation would then look something like:

ssh -L 2025:localhost:548 linuxbox


Then open a connect-to dialog and enter:

afp://127.0.0.1:2025 to mount a share from the Linux box on your desktop. Use BBEdit to edit the file as if it were local.

Breen

bluehz
03-01-2003, 12:13 AM
I installed netatalk on the machine a while back and never had much luck with it. Anyway - tried above suggestion and still getting:

channel 2: open failed: connect failed: Connection refused

on the linux box..

I am starting to think it might be some ssh problem...

sapporo
03-01-2003, 05:17 AM
WebDAV comes to mind.

bluehz
03-01-2003, 05:28 AM
I think I have identified the problem is on the Linux box - when I start Netatalk - I am seeing a msg "AFP Daemon: login disallowed" - but I can not find WHERE to allow login. Have search everywhere, looked all through the configs and find no info about allowing and disallowing login.

Anyone know where that might be?

breen
03-01-2003, 10:14 AM
Dunno -- I've never had any problems with netatalk -- it just worked.
I'll look around when I get a chance.

Breen

bluehz
03-01-2003, 10:51 AM
Well I did finally get it up and running - I think the login problem was an error with teh tcp-wrappers. It drives me nuts though that I can not access as root - its a downfall of netatalk itself. Most of the stuff I need to do on my linux box is sysadmin stuff!

I tried getting around this adding my user name into the root group and giving root group access - then loggin in as that user. Still no go. Tried adding user to sys group, still no go.

Without root access its not worth much to me since this linux box is only a server. I rarely ever login without loggin in as root.

Any suggestions on how I could get in with netatalk and access all files?

Also - how does one specify the root directory in the Applevolumes.default? I would like to offer the complete root volume as a choice. I tried:

/ root

but that did not work.

mervTormel
03-04-2003, 06:24 PM
http://highwire.stanford.edu/~snichols/bbedit.html

bluehz
03-05-2003, 06:47 AM
Thx merv - that looks interesting but still requires an ftp connection on the remote side. I ended up enabling netatalk and samba and have been comparing the two of them. So far samba is winning out - I can get root access tomy files on the remote box.

baba
03-06-2003, 09:29 AM
If it weren't for BBOpen, I wouldn't use BBEdit. It's critical to be able to open files in BBEdit from the remote host command line. I always tunnel with ssh and have BBedit listen to localhost ports via an ftp bookmark. Ftp is running normally on the server *but only makes connections with localhost*. MacSFTP is second best but lacks the critical command line functionality

russh
03-09-2003, 04:44 PM
If you use RBroswer you can connect via sftp/ssh and just OPEN the file remotely with BBEdit. It works quite well with no special configuration beyond turning on Remote Access in your System Prefs/Sharing. (Note that I do not think the free version (RBrowserLite) does ssh.)

Very secure, very easy.