Add setup.sh for debian image generator
This commit is contained in:
parent
593c152798
commit
0a1a5890ed
1
tools/qemu-debian-img/.gitignore
vendored
1
tools/qemu-debian-img/.gitignore
vendored
@ -2,3 +2,4 @@
|
||||
!.gitignore
|
||||
!Dockerfile.template
|
||||
!generate-images.sh
|
||||
!setup.sh
|
||||
|
17
tools/qemu-debian-img/setup.sh
Executable file
17
tools/qemu-debian-img/setup.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user