diff --git a/xCAT/postscripts/setupesx b/xCAT/postscripts/setupesx index 138f77733..581b13c86 100644 --- a/xCAT/postscripts/setupesx +++ b/xCAT/postscripts/setupesx @@ -1,12 +1,41 @@ # esx setup # example on how to set up ESX. We setup ssh and also add a basic # VLAN configuration +logger -t xcat setupesx +# Enable SSH access to root and exchange keys -# Enable SSH access to root sed -e 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config > /etc/ssh/sshd_config.new mv -f /etc/ssh/sshd_config.new /etc/ssh/sshd_config /etc/init.d/sshd restart +if [ -r /etc/ssh/sshd_config ] +then + logger -t xcat "Install: setup /etc/ssh/sshd_config" + cp /etc/ssh/sshd_config /etc/ssh/sshd_config.ORIG + sed -i 's/^X11Forwarding .*$/X11Forwarding yes/' /etc/ssh/sshd_config + sed -i 's/^KeyRegenerationInterval .*$/KeyRegenerationInterval 0/' /etc/ssh/sshd_config + sed -i 's/\(.*MaxStartups.*\)/#\1/' /etc/ssh/sshd_config + echo "MaxStartups 1024" >>/etc/ssh/sshd_config + echo "PasswordAuthentication no" >>/etc/ssh/sshd_config +fi + +if [ -r /etc/ssh/sshd_config ] +then + echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config +fi + +if [ -d /xcatpost/_ssh ] +then + logger -t xcat "Install: setup root .ssh" + cd /xcatpost/_ssh + mkdir -p /root/.ssh + cp -f * /root/.ssh + cd - >/dev/null + chmod 700 /root/.ssh + chmod 600 /root/.ssh/* +fi + + # create a script that will launch the first time ESX does and configure # the network cat >/tmp/esxcfg.sh </tmp/esxcfg.sh <>/etc/rc.d/rc.local <