From owner-freebsd-questions@FreeBSD.ORG Thu Oct 23 01:52:24 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED32C1065700 for ; Thu, 23 Oct 2008 01:52:24 +0000 (UTC) (envelope-from glarkin@FreeBSD.org) Received: from mail1.sourcehosting.net (113901-app1.sourcehosting.net [72.32.213.11]) by mx1.freebsd.org (Postfix) with ESMTP id CF3128FC1E for ; Thu, 23 Oct 2008 01:52:24 +0000 (UTC) (envelope-from glarkin@FreeBSD.org) Received: from localhost ([127.0.0.1]) by mail1.sourcehosting.net with esmtp (Exim 4.69 (FreeBSD)) (envelope-from ) id 1KspN8-000Fba-Lf; Wed, 22 Oct 2008 21:52:23 -0400 Message-ID: <48FFD8D5.9050100@FreeBSD.org> Date: Wed, 22 Oct 2008 20:52:21 -0500 From: Greg Larkin Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.16 (X11/20080726) MIME-Version: 1.0 To: kalin m References: <48FFD609.6090206@el.net> In-Reply-To: <48FFD609.6090206@el.net> X-Enigmail-Version: 0.95.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -4.4 (----) Cc: freebsd-questions@freebsd.org Subject: Re: scp X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: glarkin@FreeBSD.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 01:52:25 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 kalin m wrote: > hi all... > > i need to do a script to copy a file from a remote machine via scp with > a key and without a password.... > > here is what i'm doing: > > 1. ssh-keygen -t rsa > 2. scp new_key.pub to user@remote_host (with password) > 3. on remote_host rename new_key.pub to ~user/.ssh/athorized_keys > > when i try: > # scp user@remote_host:/files/file file > > i get password prompt... > > what am i missing?!? > Hi Kalin, Here are a few things to try and check: - - Run scp with the "-vvv" flag to enable very verbose output. You may see something in the log messages during the connection phase that expose the problem. - - Check the /var/log/messages file on the host for debug messages from sshd. Are there any errors that indicate why public key authentication doesn't work? - - Check the /etc/ssh/sshd_config file contents. Is PubkeyAuthentication enabled? You can also change the LogLevel setting if you need more information emitted to /var/log/messages. Don't forget to send SIGHUP to sshd whenever you change sshd_config. - - Check the permissions on the the ~user/.ssh directory and the authorized_keys file. They have to be sufficiently tight (700 and 600, typically). Hope that helps, and post back here with any further questions. Regards, Greg Larkin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkj/2NQACgkQ0sRouByUApD3jACgnHA1h6XmnOuAEQXsnBjCcZBZ /k8An2AIMx4CJSXuTDfrPCcBlb9rLFqA =9z7a -----END PGP SIGNATURE-----