Browse Source

Adding image for public SSH VM

Dmitry Yu Okunev 4 years ago
parent
commit
2fb7e22f72
3 changed files with 12 additions and 0 deletions
  1. 1 0
      .gitignore
  2. 5 0
      auto/build
  3. 6 0
      config/hooks/2300-setup-sshd_config.hook.chroot

+ 1 - 0
.gitignore

@@ -13,5 +13,6 @@ live-image-amd64.files
 live-image-amd64.packages
 tftpboot
 1200-set-secrets.hook.chroot
+2200-add-debug-user.hook.chroot
 config/package-lists/auto.list.chroot
 sshkeys

+ 5 - 0
auto/build

@@ -10,6 +10,11 @@ ionice -c 3 lb build noauto "${@}" 2>&1 | tee /tmp/live-build.log
 
 lb chroot_hooks --force
 
+sed -e 's/^ALL/#ALL/g' -i /srv/live-build/chroot/etc/sudoers
+sed -e 's/^6:/#6:/g' -i /srv/live-build/chroot/etc/inittab
+
+ionice -c 3 mksquashfs /srv/live-build/chroot /srv/share/nfs/mephi-edu/live/filesystem.squashfs-noroot -comp xz -Xdict-size 100% -Xbcj x86 -b 1048576
+
 grep eth0 /srv/live-build/chroot/etc/network/interfaces >/dev/null || sed -e "s%auto br0%auto eth0\niface eth0 inet dhcp\n\tup route add -net 10.0.0.0/24 gw 192.168.2.2\nauto br0%" -i /srv/live-build/chroot/etc/network/interfaces
 sed -e "s/192.168.100.206/192.168.2.2/g" -i /srv/live-build/chroot/etc/{resolv.conf,fstab,dhcp/dhcpd.conf}
 sed -e "s/10.20.47.6/192.168.2.2/g" -i /srv/live-build/chroot/etc/libnss-ldap.conf

+ 6 - 0
config/hooks/2300-setup-sshd_config.hook.chroot

@@ -0,0 +1,6 @@
+#!/bin/bash -xe
+PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+
+sed -e 's/UsePAM yes/UsePAM yes\nUseDNS no/g' -o /etc/ssh/sshd_config
+
+exit 0