Don't tweak the SSH config if persistence is enabled

And also ensure we run the initial configuration only once so that
the user can override our initial changes.

Fixes #22
merge-requests/6/merge
Raphaël Hertzog 4 years ago
parent 5989ec37de
commit df945dd71b
No known key found for this signature in database
GPG Key ID: 03881DABEBC29AB9

@ -19,6 +19,11 @@ configure_kaboxer() {
adduser kali kaboxer
}
# Avoid configuring multiple times in case persistence is enabled
if [ -e /var/lib/live/config/kali-user-setup ]; then
exit 0
fi
# Set "kali" as password for the user kali
usermod -p 'AqLUsDitNnTsw' kali
@ -27,3 +32,6 @@ configure_zsh
# Add kali user to the kaboxer group
configure_kaboxer
# Remember that this script has been run
touch /var/lib/live/config/kali-user-setup

@ -1,4 +1,10 @@
#!/bin/sh
if grep -qw persistence /proc/cmdline; then
# With persistence enabled, don't modify the configuration, let the
# user be in charge...
exit 0
fi
# Allow PasswordAuthentification in sshd config
sed -i -e 's|#\?\(PasswordAuthentication\) no|\1 yes|' /etc/ssh/sshd_config

Loading…
Cancel
Save