From: Ian Jackson Subject: Re: [PATCH RFC 1/4] osstest: add routine to execute ssh with password Date: Tue, 12 Aug 2014 17:37:23 +0100 Message-ID: <21482.17091.44971.775490@mariner.uk.xensource.com> References: <1407858572-32140-1-git-send-email-roger.pau@citrix.com> <1407858572-32140-2-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XHF4t-00058N-Qa for xen-devel@lists.xenproject.org; Tue, 12 Aug 2014 16:37:39 +0000 In-Reply-To: <1407858572-32140-2-git-send-email-roger.pau@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne Cc: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org Roger Pau Monne writes ("[PATCH RFC 1/4] osstest: add routine to execute ssh with password"): > This is needed when bootstrapping FreeBSD, since the installer has ssh > enabled with the root password set to 'root' by default. > + open(my $temp_fh, '>', "tmp/t.ssh-password-helper.$flight.$job") > + or die "Cannot open tmp/t.ssh-password-helper.$flight.$job: $!"; Put this pathname in a variable so that you don't have to write it three times. > + print $temp_fh "#!/bin/sh\n\necho \"$password\"\n"; or die $!; > + chmod 0755, $temp_fh; You should probably chmod the path, not the fh. That's more usual, although all of our hosts do in fact have fchmod(2). > + close $temp_fh; or die $!; Otherwise, this is fine. Thanks, Ian.