From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1P3ur6-0007fj-NF for garchives@archives.gentoo.org; Thu, 07 Oct 2010 18:06:12 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 05680E0866 for ; Thu, 7 Oct 2010 18:06:12 +0000 (UTC) Received: from smtpout.karoo.kcom.com (smtpout.karoo.kcom.com [212.50.160.34]) by pigeon.gentoo.org (Postfix) with ESMTP id 25716E0774 for ; Thu, 7 Oct 2010 17:36:31 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.57,298,1283727600"; d="scan'208";a="229819336" Received: from 213-152-39-90.dsl.eclipse.net.uk (HELO compaq.stroller.uk.eu.org) ([213.152.39.90]) by smtpout.karoo.kcom.com with ESMTP; 07 Oct 2010 18:36:31 +0100 Received: from [192.168.1.101] (unknown [192.168.1.101]) by compaq.stroller.uk.eu.org (Postfix) with ESMTP id 74B3A6C531 for ; Thu, 7 Oct 2010 18:36:28 +0100 (BST) Content-Type: text/plain; charset=us-ascii Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 (Apple Message framework v1078) Subject: Re: [gentoo-user] Copying a file via ssh with no password, keeping the system safe From: Stroller In-Reply-To: <20101007184549.65756vlexbx2u7sw@momessonet.ath.cx> Date: Thu, 7 Oct 2010 18:36:28 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <9CCC708A-F24E-496C-BD59-242170F1182E@stellar.eclipse.co.uk> References: <20101007184549.65756vlexbx2u7sw@momessonet.ath.cx> To: gentoo-user@lists.gentoo.org X-Mailer: Apple Mail (2.1078) X-Archives-Salt: 6030fb70-7764-4957-ad29-02ce60d56c94 X-Archives-Hash: aeba2927b32d91edc280d3b3ea5b03fb On 7 Oct 2010, at 17:45, Momesso Andrea wrote: > I need to set up a cron job to transfer a file every day from server A = to server B. >=20 > I'd like to do that via ssh and with no user assistance, completely = automated. >=20 > Setting up a public key, would do the job, but then, all the = connections between the servers would be passwordless, so if server A = gets compromised, also server B is screwed. >=20 > Is there a way to allow only one single command from a single cronjob = to operate passwordless, while keeping all the other connections secured = by a password? You could create a user on server B called backup, a user with very = limited permissions and no shell (/bin/false). Thus server A can = transfer files to serverb:~backup but if the key is compromised then = little else can be done. Not sure if the user could somehow be run in a chrooted ssh, for better = security? I'm not sure what files a new user "backup" would have = read-access to by default? If the key is obtained from server A then the = attacker could copy files from server B (back to wherever they like), = and it might be possible to obtain information about what services are = run on that system or otherwise learn vulnerabilities from what could be = read.=20 Stroller.