From 146686eb0d97bab588a5912e1994835001e5b459 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Sat, 16 Jan 2016 23:55:01 -0800 Subject: [PATCH] setup user, pass, ssh, etc --- fai-redep | 12 ++++++++++-- fai/config/class/50-host-classes | 9 +++++++-- fai/config/class/FAIBASE.var | 4 ---- fai/config/distro-install-common/end | 16 ++++++++++++++++ fai/config/scripts/DEMO/10-misc | 24 ------------------------ fai/config/scripts/GRUB_PC/11-ian | 14 ++++++++++++++ 6 files changed, 47 insertions(+), 32 deletions(-) create mode 100755 fai/config/distro-install-common/end delete mode 100755 fai/config/scripts/DEMO/10-misc create mode 100755 fai/config/scripts/GRUB_PC/11-ian diff --git a/fai-redep b/fai-redep index 64368e4..935e96c 100755 --- a/fai-redep +++ b/fai-redep @@ -8,11 +8,19 @@ trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR ssh root@faiserver rm -rf /srv/fai/config/\* scp -r /a/bin/fai/fai/config root@faiserver:/srv/fai -ssh root@faiserver tee -a /srv/fai/config/class/DESKTOP.var </dev/null; then + # if our eth0 mac is in the kvm range, we are a vm. + echo "VM" +fi diff --git a/fai/config/class/FAIBASE.var b/fai/config/class/FAIBASE.var index 7f0684e..f02f58a 100644 --- a/fai/config/class/FAIBASE.var +++ b/fai/config/class/FAIBASE.var @@ -10,10 +10,6 @@ UTC=yes ## changed from upstream. found in /usr/share/zoneinfo/, via fai-guide TIMEZONE=US/Pacific -# the hash of the root password for the new installed linux system -# pw is "fai" -ROOTPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1' - # errors in tasks greater than this value will cause the installation to stop STOP_ON_ERROR=700 diff --git a/fai/config/distro-install-common/end b/fai/config/distro-install-common/end new file mode 100755 index 0000000..666b781 --- /dev/null +++ b/fai/config/distro-install-common/end @@ -0,0 +1,16 @@ +#!/bin/bash -x + +set -eE -o pipefail +trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR + + + + +# based on unison error, with 8192 from +# sysctl -a | grep fs.inotify.max_user_watches +#http://stackoverflow.com/questions/535768/what-is-a-reasonable-amount-of-inotify-watches-with-linux +echo "fs.inotify.max_user_watches = 1000000" >> $target/etc/sysctl.d/99-sysctl.conf +# if we weren't rebooting, you could apply it now with: +# sysctl --system + +echo 'ian ALL=(ALL) NOPASSWD: ALL' >> $target/etc/sudoers diff --git a/fai/config/scripts/DEMO/10-misc b/fai/config/scripts/DEMO/10-misc deleted file mode 100755 index 45f0573..0000000 --- a/fai/config/scripts/DEMO/10-misc +++ /dev/null @@ -1,24 +0,0 @@ -#! /bin/bash - -# (c) Thomas Lange, 2001-2013, lange@debian.org - -error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code - -ifclass XORG && { - fcopy -M /etc/X11/xorg.conf -} - -if ifclass UBUNTU; then - groups="adm cdrom sudo dip plugdev lpadmin sambashare" - $ROOTCMD addgroup --system lpadmin || true - $ROOTCMD addgroup --system sambashare || true -fi - -# add a demo user account -if ! $ROOTCMD getent passwd demo ; then - $ROOTCMD adduser --disabled-login --gecos "fai demo user" demo - $ROOTCMD usermod -p "$ROOTPW" demo - for g in $groups; do - $ROOTCMD adduser demo $g - done -fi diff --git a/fai/config/scripts/GRUB_PC/11-ian b/fai/config/scripts/GRUB_PC/11-ian new file mode 100755 index 0000000..24a10ae --- /dev/null +++ b/fai/config/scripts/GRUB_PC/11-ian @@ -0,0 +1,14 @@ +#!/bin/bash -x + +set -eE -o pipefail +trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR + +$ROOTCMD adduser --disabled-password --gecos ian ian +$ROOTCMD usermod -p "$ROOTPW" ian + +/var/lib/fai/config/distro-install-common/end + +fcopy -r -m 1000,1000,700 -i /home/ian/.ssh + +# the defaults in wheezy +$ROOTCMD usermod -aG cdrom,floppy,sudo,audio,dip,video,plugdev,netdev ian -- 2.30.2