Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sudo su
- setxkbmap de
- apt-get update
- apt-get install --yes debootstrap
- blkdiscard /dev/vda
- sgdisk --zap-all /dev/vda
- sgdisk -n1:1M:+512M -t1:EF00 /dev/vda
- sgdisk -n2:0:+2G -t2:BE00 /dev/vda
- sgdisk -n3:0:+6G -t3:8200 /dev/vda
- sgdisk -n4:0:0 -t4:BF00 /dev/vda
- mkfs.ext4 /dev/vda4
- mount /dev/vda4 /mnt
- debootstrap \
- --arch=amd64 \
- --variant=minbase \
- focal \
- /mnt \
- http://us.archive.ubuntu.com/ubuntu/
- mount -o bind /dev /mnt/dev
- mount -o bind /dev/pts /mnt/dev/pts
- mount -t sysfs /sys /mnt/sys
- mount -t proc /proc /mnt/proc
- cp /proc/mounts /mnt/etc/mtab
- cp /etc/resolv.conf /mnt/etc/resolv.conf
- cp /etc/apt/sources.list /mnt/etc/apt/sources.list
- chroot /mnt
- echo "DESKTOP-`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 9 | head -n 1`" > /etc/hostname
- echo "nameserver 8.8.8.8" >> /etc/resolv.conf
- apt-get update
- apt-get install language-pack-de
- apt-get install console-setup
- dpkg-reconfigure tzdata
- apt install -y --no-install-recommends \
- linux-generic \
- iputils-ping dnsutils lsof isc-dhcp-client dhcpcd5 iproute2 net-tools netplan.io locales localepurge nano \
- dosfstools vim gdisk
- cat >> /etc/netplan/01-netcfg.yaml << EOF
- network:
- version: 2
- ethernets:
- enp1s0:
- dhcp4: true
- EOF
- mkdosfs -F 32 -s 1 -n EFI /dev/vda1
- mkdir /boot/efi1
- echo /dev/disk/by-uuid/$(blkid -s UUID -o value /dev/vda1) \
- /boot/efi1 vfat defaults 0 0 >> /etc/fstab
- mount /boot/efi1
- mkdir /boot/efi1/grub
- mkdir /boot/grub1
- echo /boot/efi1/grub /boot/grub1 none defaults,bind 0 0 >> /etc/fstab
- mount /boot/grub1
- apt install --yes \
- grub-efi-amd64 grub-efi-amd64-signed \
- shim-signed
- passwd
- mkswap -f /dev/vda3
- echo /dev/disk/by-uuid/$(blkid -s UUID -o value /dev/vda3) \
- none swap discard 0 0 >> /etc/fstab
- echo /dev/disk/by-uuid/$(blkid -s UUID -o value /dev/vda4) \
- / ext4 errors=remount-ro 0 1 >> /etc/fstab
- cp /usr/share/systemd/tmp.mount /etc/systemd/system/
- systemctl enable tmp.mount
- addgroup --system lpadmin
- addgroup --system lxd
- addgroup --system sambashare
- apt-get install -y initramfs-tools
- update-initramfs -c -k all
- cat > /etc/default/grub << EOF
- GRUB_DEFAULT=0
- GRUB_TIMEOUT=5
- GRUB_RECORDFAIL_TIMEOUT=5
- GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Ubuntu`
- GRUB_CMDLINE_LINUX_DEFAULT=""
- GRUB_CMDLINE_LINUX=""
- GRUB_TERMINAL=console
- EOF
- update-grub
- grub-install --target=x86_64-efi --efi-directory=/boot/efi1 \
- --bootloader-id=ubuntu --recheck --no-floppy
- apt install --yes openssh-server mlocate
- adduser serveradmin
- cp -a /etc/skel/. /home/serveradmin
- chown -R serveradmin:serveradmin /home/serveradmin
- chmod -R o-rwx /home/serveradmin
- usermod -a -G adm,cdrom,dip,lpadmin,lxd,plugdev,sambashare serveradmin
- for file in /etc/logrotate.d/* ; do
- if grep -Eq "(^|[^#y])compress" "$file" ; then
- sed -i -r "s/(^|[^#y])(compress)/\1#\2/" "$file"
- fi
- done
- exit
- reboot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement