Knit 1, perl 5.6.0
Oct. 30th, 2002 10:36 pmNot all is happiness and chowder in OSX land. My feet were set upon the path of troubles by ScriptGUI, a splendid little app that lets me run scripts (perl, shell) by double-clicking on them. This lets me keep a drawer full of scripts behind a pop-up tab at the edge of my monitor (pop-up tabs at the edges of one’s monitor are where all oft-used commands and icons belong). ScriptGUI is even willing to pop up a window to display STDOUT output and accept STDIN input, which is where the trouble comes in.
See, I’ve got a couple of scripts I use to move files between my home box and my server, using scp, the secure copy utility, which hides my sensitive password and other info behind a wall of encryption, safe from spying packet-sniffing cyber-noses. There are perl modules that’ll act as front ends for scp (and ssh, the related secure shell), but I’ve never successfully gotten any of them to work. Not much of a problem, though, since in the case of both my scripts, the scp transfer is the last thing that happens, so rather than bothering perl’s pretty little code about it, I just have the last statement in the perl script be an exec that calls scp with the relevant parameters. The perl script ends, invoking scp with its dying gasp, and the shell takes over, prompting me for my password. Works fine.
Not so fine with ScriptGUI, which isn’t willing to just fob things off on the shell. Time to rewrite the scripts to do things the formal way, interacting with ssh via the modules and asking for my password via STDOUT and STDIN. Off to CPAN to download the modules. Net::SSH::Perl has a lot of dependencies — other modules which need to be installed before it. OK, no prob, CPAN has those, too. Uh oh, they’ve got dependencies too, and one of them just won’t install, it can’t find gmp.h, which is the header file for, um, a GNU math library of some kind, I think. Crap. At least there seems to be a stable version in Fink, but geez, I don’t even have Fink installed, and I seem to have used up my gumption for the day. Time to just sit down and read comics.
(no subject)
Date: 2002-10-30 10:23 pm (UTC)Ooh, I just found something on O'Reilly's MacDev site.
(no subject)
Date: 2002-10-30 10:40 pm (UTC)It doesn't restrict the command that can be executed remotely to just scp, but leaves the remote system open to any command from the Mac executed via ssh. But you could generate another key pair and play around with the entry for that public key in authorized_keys2.