Merge pull request #44 from caodg/master

add USER/.ssh/config to disable StrictHostKeyChecking
This commit is contained in:
Cao, Donggang 2016-04-11 21:48:07 +08:00
commit d30d22861d
2 changed files with 21 additions and 0 deletions

View File

@ -22,3 +22,9 @@ SSH_DIR=$USER_DIR/ssh
# maybe it should be delete
ssh-keygen -t rsa -P '' -f $SSH_DIR/id_rsa &>/dev/null
cp $SSH_DIR/id_rsa.pub $SSH_DIR/authorized_keys
cat << EOF > $SSH_DIR/config
Host *
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
EOF

View File

@ -72,7 +72,9 @@ echo "[*] Masking dbus.service"
chroot $BASEFS systemctl mask dbus.service
echo "[*] Disabling apache2 service(if installed)"
if [ -d $BASEFS/etc/apache2 ] ; then
chroot $BASEFS update-rc.d apache2 disable
fi
echo "[*] Disabling ondemand service(if installed)"
chroot $BASEFS update-rc.d ondemand disable
@ -81,10 +83,14 @@ echo "[*] Disabling dbus service(if installed)"
chroot $BASEFS update-rc.d dbus disable
echo "[*] Disabling mysql service(if installed)"
if [ -d $BASEFS/etc/mysql ] ; then
chroot $BASEFS update-rc.d mysql disable
fi
echo "[*] Disabling nginx service(if installed)"
if [ -d $BASEFS/etc/nginx ] ; then
chroot $BASEFS update-rc.d nginx disable
fi
echo "[*] Setting worker_processes of nginx to 1(if installed)"
[ -f $BASEFS/etc/nginx/nginx.conf ] && sed -i -- 's/worker_processes\ auto/worker_processes\ 1/g' $BASEFS/etc/nginx/nginx.conf
@ -104,3 +110,12 @@ cp npmrc $BASEFS/root/.npmrc
echo "[*] Copying DOCKLET_NOTES.txt to $BASEFS/root/DOCKLET_NOTES.txt"
cp DOCKLET_NOTES.txt $BASEFS/root/
echo "[*] Updating USER/.ssh/config to disable StrictHostKeyChecking"
for f in $FS_PREFIX/global/users/* ; do
cat <<EOF > $f/ssh/config
Host *
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
EOF
done