From 7161b971e5400bbd66067b8f5fba4c97f6052343 Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 16 Mar 2010 16:59:48 +0000 Subject: [PATCH] must create .ssh directory, if it does not exist before creating the config file in it git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5485 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/bin/xdsh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/xCAT-client/bin/xdsh b/xCAT-client/bin/xdsh index c57ffb85d..4a565017f 100644 --- a/xCAT-client/bin/xdsh +++ b/xCAT-client/bin/xdsh @@ -369,6 +369,21 @@ sub parse_args_xdsh # Get the home directory my $home = xCAT::Utils->getHomeDir($current_userid); $ENV{'DSH_FROM_USERID_HOME'} = $home; + # + # create /.ssh dir if needed + # + my $sshdir = "$home/.ssh"; + if (!-d $sshdir) + { + my $cmd = "/bin/mkdir -m 700 -p $sshdir"; + my $outref = xCAT::Utils->runcmd("$cmd", 0); + if ($::RUNCMD_RC != 0) + { + xCAT::MsgUtils->message('E', "Could not create $sshdir directory."); + exit 1; + } + } + # add config file with strict host checking no my $cmd = "echo \"StrictHostKeyChecking no\" >> $home/.ssh/config";