Using SSH with BBEdit

4,334 views
Skip to first unread message

Bruce Van Allen

unread,
May 5, 2009, 5:10:52 PM5/5/09
to bbe...@googlegroups.com
Hi All,

An ISP where I will be hosting some web apps has opened SSH
access for me.

I haven't had the occasion to use SSH before now, so I'm going
through the SSH manuals, checking the docs of various programs,
and searching around for articles and tips.

I've seen bits and pieces about SSH on this list over the years,
so I know there are folks who use BBEdit with this form of
remote access. It's a rare day that I don't have many local and
remote files open in BBEdit. So I'd love to hear from anyone on
this list if you have a favorite practice with SSH, or can point
me to useful resources. (Post here so others might benefit as well.)

Thanks!

- Bruce

_bruce__van_allen__santa_cruz_ca_

Doug McNutt

unread,
May 5, 2009, 8:31:47 PM5/5/09
to bbe...@googlegroups.com
At 14:10 -0700 5/5/09, Bruce Van Allen wrote:
>So I'd love to hear from anyone on
>this list if you have a favorite practice with SSH, or can point
>me to useful resources. (Post here so others might benefit as well.)

BBEdit worksheets work well with the scp flavor of ssh but they're not so good with an ssh shell that may want typed-in feedback for some things.

If you create a public/private key pair with ssh-keygen and put the results in your home folder's .ssh directory, which you might have to create, you can populate $HOME/.ssh/authorized_keys, on your hosting site, with your public key. Note that dot in .ssh. Apple's Finder will want to hide that from you. You can make a link to it with

ln $HOME/.ssh $HOME/_ssh

With that done and probably some messing with keychains or the ssh-add tool you'll find that commands like

scp localfiles*.txt yourhost:/

placed in a BBEdit worksheet for reuse will be easily executable. It beats ftp because wild cards are allowed. If you want the wild card to apply on the external host, include it in quote marks so your local shell doesn't try to interpret them.

Actually, I tend to place my scp commands in commented form right into html files. There's nothing secret about them and you can copy and paste the line into a shell window or a BBEdit worksheet for execution. (And yes. I really wish we could execute them from within the html file as displayed by BBEdit but that went away in BBEdit 6 or so.) It's a whole lot easier to copy and modify an existing scp command in a worksheet than it is to type it completely into a shell window.

You can also do things like

ssh yourhost: "ls"

to return stdout into your worksheet. Just don't try anything that will ask you for input.

You will probably want to set up, in $HOME/.ssh, a config file that can be used to provide your username on the remote host and perhaps an IP address.

Be careful though. There is no automatic conversion of line ends as there can be with ftp. You'll have to have them right before you upload.

--
-> Stocks are getting pelloreid <-

Bill

unread,
May 6, 2009, 11:33:28 AM5/6/09
to BBEdit Talk
I use ssh+bbedit all the time using the built in ftp capabilities of
BBEdit
- just switch to sftp instead of standard ftp. To quote the manual,
"It can also open and save files directly via SFTP (SSH File Transfer
Protocol)...
Aside from choosing the SFTP checkbox in the Open from…/Save to…
dialogs, or the
FTP/SFTP Browser, opening and saving files via SFTP works just like it
does when
using ordinary FTP. A file opened via SFTP will appear in the Open
Recent submenu
with an “sftp:” URL, and you can send a “get URL” event to BBEdit with
an “sftp” URL
as well."

Steve Saeedi

unread,
May 6, 2009, 11:45:40 AM5/6/09
to bbe...@googlegroups.com
I use MacFUSE with sshfs. I can mount as volumes any server vis an ssh
connection. BBEdit then can access the files as any other file on a
mounted volume.

- Steve

Corey Ehmke

unread,
May 6, 2009, 11:55:05 AM5/6/09
to BBEdit Talk
For years I've been using Fugu (http://rsug.itd.umich.edu/software/
fugu/) for its transparent SFTP, SCP, and SSH tunneling capabilities;
it behaves just like an FTP client for connecting remotely and
securely. From Fugu, you can select a file to edit and have it open up
in BBEdit. Pretty simple and seamless; save from BBEdit, and Fugu
uploads your changes automatically in the background.

--C

Jonathan Lundell

unread,
May 6, 2009, 11:58:50 AM5/6/09
to bbe...@googlegroups.com
On May 6, 2009, at 8:45 AM, Steve Saeedi wrote:

> I use MacFUSE with sshfs. I can mount as volumes any server vis an ssh
> connection. BBEdit then can access the files as any other file on a
> mounted volume.

MacFUSE is good (and ExpanDrive is a nice, relatively inexpensive, UI
for it, along with some other optimizations). File transfers are a
little slow, but for most web work it's fine, and having remote files
show up in the Finder is handy.

You can open files over ssh (sftp) directly from BBEdit as well.

Various ftp/sftp clients (Interarchy, RBrowser, Fetch, Transmit)
coexist nicely with BBEdit as well. Fugu falls into this category, but
it makes me a little nervous that the last version came out in 2005.

And finally (all I can think of right now, anyway) there's rsync over
ssh. I use this for a couple of my own sites. I keep the master files
locally, and then invoke rsync via a shell script from the BBEdit #!-
>Unix Scripts menu.

As has been mentioned already, all of these are more convenient if you
set up key-based authentication, and save yourself the hassle of
supplying username/password all the time.

Tim Gray

unread,
May 7, 2009, 8:09:08 AM5/7/09
to BBEdit Talk
On May 6, 11:58 am, Jonathan Lundell <jlund...@pobox.com> wrote:
> Various ftp/sftp clients (Interarchy, RBrowser, Fetch, Transmit)  
> coexist nicely with BBEdit as well. Fugu falls into this category, but  
> it makes me a little nervous that the last version came out in 2005.

Since no one mentioned it, I wanted to mention Cyberduck. It's a
pretty good donation-ware ftp/sftp client. Lets you double click a
file in the browser and have it open up seamlessly in BBEdit. Then
when you save it, Cyberduck automatically updates the copy on the
server. Between that and BBEdit's sftp support, I can do pretty much
what I need to do on remote servers.

Dennis Whiteman

unread,
May 7, 2009, 10:53:28 AM5/7/09
to BBEdit Talk


On May 7, 7:09 am, Tim Gray <tg...@125px.com> wrote:
> Since no one mentioned it, I wanted to mention Cyberduck.  It's a
> pretty good donation-ware ftp/sftp client.  Lets you double click a
> file in the browser and have it open up seamlessly in BBEdit.

The integration with BBEdit (and TextWrangler) works very well. While
I've used the builtin sftp/ftp support in BBEdit a few times, I prefer
Cyberduck as a personal preference because I'm dealing with a lot of
image and audio files.

The support for shell scripts, subversion and many other things via
ssh in BBEdit, OTOH, is invaluable.

Dennis
Reply all
Reply to author
Forward
0 new messages