From owner-freebsd-questions Sat Sep 28 12:35: 7 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2CBE837B401 for ; Sat, 28 Sep 2002 12:35:05 -0700 (PDT) Received: from hivemind.trini0.org (bgp626680bgs.brick201.nj.comcast.net [68.39.132.244]) by mx1.FreeBSD.org (Postfix) with SMTP id 711BA43E77 for ; Sat, 28 Sep 2002 12:35:04 -0700 (PDT) (envelope-from gsam@trini0.org) Received: (qmail 12412 invoked by uid 0); 28 Sep 2002 19:35:03 -0000 Received: from unknown (HELO trini0.org) (192.168.0.3) by hivemind.trini0.org with SMTP; 28 Sep 2002 19:35:03 -0000 Message-ID: <3D960467.5080708@trini0.org> Date: Sat, 28 Sep 2002 15:35:03 -0400 From: Gerard Samuel User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.0.1) Gecko/20020915 X-Accept-Language: en-us, en MIME-Version: 1.0 To: FreeBSD Questions Subject: passwordless scp and cronjobs Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 A few months ago, I had a cron job scp a file to another box within my lan. It worked great and things were good. I dont remember why I turned it off, but Im trying to set it back up. Both boxes are running FBSD 4.6.2-Release. On the sending box -> 1. ssh-keygen -t rsa //Accept the defaults and leave the passphrase empty. 2. scp id_rsa.pub sys_dev@hivemind: //SCP the public key over to the recieving box to the user who is going to recieve the file from the cron job. On the recieving box -> 1. cp id_rsa.pub .ssh/authorized_keys // Copy the sender's public key to .ssh/authorized_keys From the sending box, I run my script using the -v option to scp to be verbose. Here is the output of the script -> ---------------------------- Executing: program /usr/bin/ssh host hivemind, user sys_dev, command scp -v -t . OpenSSH_3.4p1 FreeBSD-20020702, SSH protocols 1.5/2.0, OpenSSL 0x0090605f debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Rhosts Authentication disabled, originating port will not be trusted. debug1: ssh_connect: needpriv 0 debug1: Connecting to hivemind.trini0.org [192.168.0.2] port 22. debug1: Connection established. debug1: identity file /home/gsam/.ssh/identity type -1 debug1: identity file /home/gsam/.ssh/id_rsa type 1 debug1: identity file /home/gsam/.ssh/id_dsa type -1 debug1: Remote protocol version 1.99, remote software version OpenSSH_3.4p1 FreeBSD-20020702 debug1: match: OpenSSH_3.4p1 FreeBSD-20020702 pat OpenSSH* debug1: Local version string SSH-1.5-OpenSSH_3.4p1 FreeBSD-20020702 debug1: Waiting for server public key. debug1: Received server public key (768 bits) and host key (1024 bits). debug1: Host 'hivemind.trini0.org' is known and matches the RSA1 host key. debug1: Found key in /home/gsam/.ssh/known_hosts:1 debug1: Encryption type: 3des debug1: Sent encrypted session key. debug1: cipher_init: set keylen (16 -> 32) debug1: cipher_init: set keylen (16 -> 32) debug1: Installing crc compensation attack detector. debug1: Received encrypted confirmation. debug1: Doing password authentication. sys_dev@hivemind.trini0.org's password: -------------------------- Could someone point out to me where Im going wrong with this to have the cron job complete successfully without entering a password. Thanks. -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message