1
0

Add setup.sh for debian image generator

This commit is contained in:
dump_stack() 2023-05-12 12:08:03 +00:00
parent 593c152798
commit 0a1a5890ed
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
2 changed files with 18 additions and 0 deletions

View File

@ -2,3 +2,4 @@
!.gitignore
!Dockerfile.template
!generate-images.sh
!setup.sh

17
tools/qemu-debian-img/setup.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh -eux
TMPDIR=$1
chroot $TMPDIR /bin/sh -c 'useradd -m user'
sed -i 's/root:\*:/root::/' $TMPDIR/etc/shadow
sed -i 's/user:!!:/user::/' $TMPDIR/etc/shadow
echo auth sufficient pam_permit.so > $TMPDIR/etc/pam.d/sshd
sed -i '/PermitEmptyPasswords/d' $TMPDIR/etc/ssh/sshd_config
echo PermitEmptyPasswords yes >> $TMPDIR/etc/ssh/sshd_config
sed -i '/PermitRootLogin/d' $TMPDIR/etc/ssh/sshd_config
echo PermitRootLogin yes >> $TMPDIR/etc/ssh/sshd_config
echo '#!/bin/sh' > $TMPDIR/etc/rc.local
echo 'dhclient' >> $TMPDIR/etc/rc.local
chmod +x $TMPDIR/etc/rc.local