diff --git a/installer/install1.sh b/installer/install1.sh index 69331e68..b502ec57 100755 --- a/installer/install1.sh +++ b/installer/install1.sh @@ -4,12 +4,15 @@ # and consoleblank permanently # # Ubuntu server 14.04.1, x64 # # # -# v0.05 by mo, DTAG, 2014-12-18 # +# v0.07 by mo, DTAG, 2015-01-20 # ############################################################# # Let's replace "quiet splash" options and update grub -sed -i.bak 's#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"#GRUB_CMDLINE_LINUX_DEFAULT="consoleblank=0"#' /etc/default/grub +sed -i 's#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"#GRUB_CMDLINE_LINUX_DEFAULT="consoleblank=0"#' /etc/default/grub +sed -i 's#\#GRUB_GFXMODE=640x480#GRUB_GFXMODE=800x600#' /etc/default/grub update-grub +sed -i 's#FONTFACE="VGA"#FONTFACE="Terminus"#' /etc/default/console-setup +sed -i 's#FONTSIZE="16"#FONTSIZE="12x6"#' /etc/default/console-setup # Let's move the install script to rc.local and reboot mv /root/install.sh /etc/rc.local && sleep 2 && reboot diff --git a/installer/install2.sh b/installer/install2.sh index 40db0507..12da93aa 100755 --- a/installer/install2.sh +++ b/installer/install2.sh @@ -3,9 +3,12 @@ # T-Pot Community Edition post install script # # Ubuntu server 14.04, x64 # # # -# v0.19 by mo, DTAG, 2014-12-18 # +# v0.20 by mo, DTAG, 2015-01-20 # ######################################################## +# Let's fit more on the screen +setupcon + # Let's make sure there is a warning if running for a second time if [ -f install.log ]; then fuECHO "### Running more than once may complicate things. Erase install.log if you are really sure." @@ -44,20 +47,7 @@ apt-get dist-upgrade -y # Let's install all the packages we need fuECHO "### Installing packages." -apt-get install ntp lxc-docker git -y - -# Create the data partition and limit its size -# If we want to extent the size of that filesystem later, without loss of data: -# resize2fs -p data.img 8192M -#fuECHO "### Creating data partition (Please be patient, this may take a while)." -#mkdir -p /opt/virtual-disk/ -#dd if=/dev/zero of=/opt/virtual-disk/data.ext4 bs=1024 count=4096000 -#mkfs.ext4 /opt/virtual-disk/data.ext4 -F -#tee -a /etc/fstab < /data/puppet/name.conf # Let's patch sshd_config fuECHO "### Patching sshd_config to listen on port 64295 and deny password authentication." sed -i 's#Port 22#Port 64295#' /etc/ssh/sshd_config sed -i 's#\#PasswordAuthentication yes#PasswordAuthentication no#' /etc/ssh/sshd_config -# Disable ssh service +# Let's disable ssh service mv /etc/init/ssh.conf /etc/init/ssh.conf.disable -# Let's add the ssh keys -#fuECHO "### Adding ssh keys for the admin user." -#mkdir -p /home/admin/.ssh/ -#tee /home/admin/.ssh/authorized_keys < /etc/rc.local.new -echo "# Let's add the first local ip to the /etc/issue file" >> /etc/rc.local.new -echo 'sed -i "s#IP:.*#IP: ""$(hostname -I | awk '"'"'{ print $1 }'"'"')""#" /etc/issue' >> /etc/rc.local.new -echo "exit 0" >> /etc/rc.local.new +tee /etc/rc.local.new < >(tee "install.err") -exec > >(tee "install.log") - -# Let's create a function for colorful output -fuECHO () { - local myRED=1 - local myWHT=7 - tput setaf $myRED - echo $1 "$2" - tput setaf $myWHT -} - -# Let's modify the sources list -sed -i '/cdrom/d' /etc/apt/sources.list - -# Let's add the docker repository -fuECHO "### Adding docker repository." -apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 -tee /etc/apt/sources.list.d/docker.list < /data/puppet/name.conf - -# Let's modify the ownership / access rights -chmod 760 -R /data -chown bee:bee -R /data - -# Let's patch sshd_config -fuECHO "### Patching sshd_config to listen on port 64295 and deny password authentication." -sed -i 's#Port 22#Port 64295#' /etc/ssh/sshd_config -sed -i 's#\#PasswordAuthentication yes#PasswordAuthentication no#' /etc/ssh/sshd_config - -# Let's add the ssh keys -fuECHO "### Adding ssh keys for the hive user." -mkdir -p /home/hive/.ssh/ -tee /home/hive/.ssh/authorized_keys < /etc/rc.local.new -echo "# Let's add the first local ip to the /etc/issue file" >> /etc/rc.local.new -echo 'sed -i "s#IP:.*#IP: ""$(hostname -I | awk '"'"'{ print $1 }'"'"')""#" /etc/issue' >> /etc/rc.local.new -echo "exit 0" >> /etc/rc.local.new -chmod +x /etc/rc.local.new - -# Final steps -fuECHO "### Thanks for your patience. Now rebooting." -mv /etc/rc.local.new /etc/rc.local && sleep 2 && reboot diff --git a/preseed/tpotce.seed b/preseed/tpotce.seed index 2d6a3ed3..eeabe2bd 100755 --- a/preseed/tpotce.seed +++ b/preseed/tpotce.seed @@ -1,4 +1,4 @@ -# Beehive preseed file by mo +# T-Pot CE preseed file by mo # Setting locale d-i debian-installer/language string en d-i debian-installer/country string DE @@ -24,44 +24,6 @@ d-i clock-setup/utc boolean true d-i time/zone string Europe/Berlin d-i clock-setup/ntp boolean true -# Partitioning -# old, not working with nuc -#d-i partman-auto/init_automatically_partition select biggest_free -#d-i partman-auto/choose_recipe select atomic -#d-i partman-auto/method string regular -#d-i partman-lvm/confirm boolean true -#d-i partman-lvm/confirm_nooverwrite boolean true -#d-i partman-lvm/device_remove_lvm boolean true -#d-i partman-md/device_remove_md boolean true -#d-i partman/default_filesystem string ext4 -#d-i partman-partitioning/confirm_write_new_label boolean true -#d-i partman/choose_partition select finish -#d-i partman/confirm boolean true -#d-i partman/confirm_nooverwrite boolean true - -# testing, works with nuc, but trying ks file first -#d-i partman-auto/disk string /dev/sda -#d-i partman-auto/choose_recipe select atomic -#d-i partman-auto/method string regular -#d-i partman-lvm/confirm boolean true -#d-i partman-lvm/confirm_nooverwrite boolean true -#d-i partman-lvm/device_remove_lvm boolean true -#d-i partman-md/device_remove_md boolean true -#d-i partman/default_filesystem string ext4 -#d-i partman-partitioning/confirm_write_new_label boolean true -#d-i partman/choose_partition select finish -#d-i partman/confirm boolean true -#d-i partman/confirm_nooverwrite boolean true - -# User setup -#d-i passwd/user-fullname string admin -#d-i passwd/username string admin - -# Encrypted using an MD5 hash (printf "password" | mkpasswd -s -m md5) -#d-i passwd/user-password-crypted password $1$8deB8hXr$S/5SDG559KmAPGAL62s3i1 -#d-i user-setup/allow-password-weak boolean true -#d-i user-setup/encrypt-home boolean false - # Package Groups tasksel tasksel/first multiselect ubuntu-server @@ -71,15 +33,10 @@ d-i pkgsel/include string openssh-server # Update Policy d-i pkgsel/update-policy select unattended-upgrades -# Grub -#d-i grub-installer/only_debian boolean true - # Post install d-i preseed/late_command string \ cp /cdrom/tpotce/install1.sh /target/etc/rc.local; \ cp /cdrom/tpotce/install2.sh /target/root/install.sh -#mkdir -p /target/root/images/; \ -#cp /cdrom/tpotce/images/* /target/root/images/ # Reboot d-i finish-install/reboot_in_progress note