From 6963dd836d39ccfee3038504627479eca5ab86b1 Mon Sep 17 00:00:00 2001 From: Donggang Cao Date: Mon, 11 Apr 2016 09:39:25 -0400 Subject: [PATCH] add USER/.ssh/config to disable StrictHostKeyChecking --- src/userinit.sh | 6 ++++++ tools/update-basefs.sh | 15 +++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/userinit.sh b/src/userinit.sh index 3ae8e0f..d33b538 100755 --- a/src/userinit.sh +++ b/src/userinit.sh @@ -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 diff --git a/tools/update-basefs.sh b/tools/update-basefs.sh index a19d6e0..292aa2f 100755 --- a/tools/update-basefs.sh +++ b/tools/update-basefs.sh @@ -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 < $f/ssh/config +Host * + StrictHostKeyChecking no + UserKnownHostsFile=/dev/null +EOF +done