diff --git a/xCAT-server-2.0/lib/xcat/plugins/mknb.pm b/xCAT-server-2.0/lib/xcat/plugins/mknb.pm index b5628b311..c38df2b56 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/mknb.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/mknb.pm @@ -68,7 +68,9 @@ sub process_request { return; } mkpath($tempdir."/root/.ssh"); + chmod(0700,$tempdir."/root/.ssh"); copy("/root/.ssh/id_rsa.pub","$tempdir/root/.ssh/authorized_keys"); + chmod(0600,"$tempdir/root/.ssh/authorized_keys"); if (-r "$installdir/postscripts/hostkeys/ssh_host_key") { copy("$installdir/postscripts/hostkeys/ssh_host_key","$tempdir/etc/ssh_host_key"); copy("$installdir/postscripts/hostkeys/ssh_host_rsa_key","$tempdir/etc/ssh_host_rsa_key");