From owner-freebsd-questions Sat Jan 5 16:21:18 2002 Delivered-To: freebsd-questions@freebsd.org Received: from stereophonic.noops.org (adsl-63-195-97-84.dsl.snfc21.pacbell.net [63.195.97.84]) by hub.freebsd.org (Postfix) with SMTP id 1214137B400 for ; Sat, 5 Jan 2002 16:21:02 -0800 (PST) Received: (qmail 49934 invoked by uid 1000); 6 Jan 2002 00:21:03 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 6 Jan 2002 00:21:03 -0000 Date: Sat, 5 Jan 2002 16:21:03 -0800 (PST) From: Thomas Cannon To: Gerard Samuel Cc: FreeBSD Questions Subject: Re: scp job In-Reply-To: <3C3794F0.8050807@optonline.net> Message-ID: <20020105161404.F49802-100000@stereophonic.noops.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://www.cvm.uiuc.edu/~ms-drake/linux/ssh_nopw.html is how you ssh/scp without a password. Your 'permission denied' also might be you not having write permissions to where you are trying to put that file, too. From reading what you've done, I also think you might have it backwards. You run ssh-keygen on the sending box, not the recieving one. -tcannon PS: you should also either set your $PATH in the script or use absolute path names, like /usr/local/bin/zip, /usr/bin/scp, etc. Your script won't run without that, as cron won't have /usr/local/bin in it's path (most likely), and it's also a little bit more secure to use complete path names. PPS: Also, if you do a 'ssh -v' you'll get verbose output, and it's likely that you'll see why your login is failing, if it actually is. On Sat, 5 Jan 2002, Gerard Samuel wrote: > Hey all. Im trying to setup a cron job involving scp. > So Im trying to make a script. > All the boxes are on my lan. > On the recieving box, I ran ssh-keygen and copyed the identity file via > scp to where the script is supposed to run. Here is the script > --------------------------------------- > > #!/bin/sh > zip -r /tmp/html_dev /files/www/data/test > scp -i /root/bin/identity /tmp/html_dev.zip developer@gatekeeper: > rm /tmp/html_dev.zip > > ---------------------------------------- > > When I try to run it I get this after its finished the zip portion. > > Permission denied. > lost connection > > I tried using the identity.pub file also, but no dice.. > How does one automate scp to get its password so the script could finish > the job?? > > Thanks > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message