From 0a35ed1193045a86e6f45552d4a566ed7d9bb6f7 Mon Sep 17 00:00:00 2001 From: lissav Date: Mon, 9 Feb 2009 18:49:48 +0000 Subject: [PATCH] fix ssh files are copied to /install/postscripts/_ssh not /install/postscripts/.ssh git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2712 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Utils.pm | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 9fa3323a6..9f5ba1bae 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -1103,7 +1103,7 @@ sub setupSSH my @nodes = $ref_nodes; my @badnodes = (); my $n_str = join ',', @nodes; - my $SSHdir = "/install/postscripts/.ssh"; + my $SSHdir = "/install/postscripts/_ssh"; if (!($ENV{'DSH_REMOTE_PASSWORD'})) { my $rsp = (); @@ -1159,7 +1159,7 @@ sub setupSSH { mkdir("/install", 0755); mkdir("/install/postscripts", 0755); - mkdir("/install/postscripts/.ssh", 0755); + mkdir("/install/postscripts/_ssh", 0755); } # Generate the keys, if they do not already exist @@ -1246,7 +1246,21 @@ rmdir(\"/tmp/$to_userid\");"; xCAT::MsgUtils->message("E", $rsp, $::CALLBACK); } + # Remove $home/.ssh/authorized_keys* + # Easy to remote this code, if we want + # The MN to be able to ssh to itself + $cmd = "rm $home/.ssh/authorized_keys*"; + xCAT::Utils->runcmd($cmd, 0); + my $rsp = {}; + if ($::RUNCMD_RC != 0) + { + $rsp->{data}->[0] = "$cmd failed.\n"; + xCAT::MsgUtils->message("E", $rsp, $::CALLBACK); + return (1); + + } + # must always check to see if worked, run test foreach my $n (@nodes) { @@ -1281,7 +1295,7 @@ rmdir(\"/tmp/$to_userid\");"; =head3 cpSSHFiles Copies the ssh keyfiles and the copy perl script into - /install/postscripts/.ssh. and the $HOME/.ssh directory of + /install/postscripts/_ssh. and the $HOME/.ssh directory of userid Arguments: