mvo's patch to show a message until a user has a password

This commit is contained in:
Michael Hudson-Doyle 2016-11-09 14:23:31 +13:00
parent c3a5a78784
commit cbd2aa5321
4 changed files with 15 additions and 1 deletions

View File

@ -0,0 +1,2 @@
Please login to this system via ssh.

View File

@ -8,6 +8,18 @@ trap true HUP INT QUIT TSTP
# happened and need to force it on. Yay UNIX! # happened and need to force it on. Yay UNIX!
stty icrnl -echo stty icrnl -echo
# check if we have extrausers that have no password set
if grep -qE '^[-a-z0-9+.-_]+:x:' /var/lib/extrausers/passwd && ! grep -qE '^[-a-z0-9+.-_]+:\$[0-9]+\$.*:' /var/lib/extrausers/shadow; then
cat /usr/share/subiquity/console-conf-ssh-login-only
# FIXME: do something better
read REPLY
fi
# all done and the user has a password
if [ -e /var/lib/console-conf/complete ]; then
exit 0
fi
if [ "$(snap managed)" = "true" ]; then if [ "$(snap managed)" = "true" ]; then
touch /var/lib/console-conf/complete touch /var/lib/console-conf/complete
exit 0 exit 0

View File

@ -4,7 +4,6 @@ After=systemd-user-sessions.service plymouth-quit-wait.service
After=rc-local.service After=rc-local.service
IgnoreOnIsolate=yes IgnoreOnIsolate=yes
ConditionPathExists=/dev/tty0 ConditionPathExists=/dev/tty0
ConditionPathExists=!/var/lib/console-conf/complete
[Service] [Service]
Environment=PYTHONPATH=/usr/share/subiquity Environment=PYTHONPATH=/usr/share/subiquity

View File

@ -1,4 +1,5 @@
bin/console-conf-tui usr/share/subiquity bin/console-conf-tui usr/share/subiquity
bin/console-conf-wait usr/share/subiquity bin/console-conf-wait usr/share/subiquity
bin/console-conf-ssh-login-only usr/share/subiquity
bin/console-conf-wrapper usr/share/subiquity bin/console-conf-wrapper usr/share/subiquity
usr/share/subiquity/console_conf usr/share/subiquity/console_conf