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_
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 <-
- Steve
> 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.