Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Jan 2002 16:21:03 -0800 (PST)
From:      Thomas Cannon <tcannon@noops.org>
To:        Gerard Samuel <trini0@optonline.net>
Cc:        FreeBSD Questions <questions@FreeBSD.ORG>
Subject:   Re: scp  job
Message-ID:  <20020105161404.F49802-100000@stereophonic.noops.org>
In-Reply-To: <3C3794F0.8050807@optonline.net>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020105161404.F49802-100000>