diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 84efc787e..09685e22c 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -136,7 +136,7 @@ sub subvars { # append preseed directive lines while () { chomp $_; - if (/^\s*#.*/ ){ + if ((/^\s*#.*/ ) || ( $_ =~ /^-/ )){ next; } $pkglist .= " " . $_; diff --git a/xCAT/postscripts/remoteshell b/xCAT/postscripts/remoteshell index b5778c9df..dc9c14e22 100755 --- a/xCAT/postscripts/remoteshell +++ b/xCAT/postscripts/remoteshell @@ -55,10 +55,13 @@ then sed -i '/MaxStartups /'d /etc/ssh/sshd_config echo "MaxStartups 1024" >>/etc/ssh/sshd_config - if [ "$SETUPFORPCM" = "1" ];then - sed -i '/PasswordAuthentication /'d /etc/ssh/sshd_config - echo "PasswordAuthentication yes" >>/etc/ssh/sshd_config - + if [ "$SETUPFORPCM" = "1" ]; then + if [[ $OSVER == sles* ]];then + sed -i '/PasswordAuthentication /'d /etc/ssh/sshd_config + echo "PasswordAuthentication yes" >>/etc/ssh/sshd_config + elif [[ $OSVER == ubuntu* ]];then + sed -i 's/^PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config + fi fi fi