diff options
author | Helmut Grohne <helmut@subdivi.de> | 2024-03-28 16:02:33 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2024-03-28 16:02:33 +0100 |
commit | da2d22d423c5085cd65f30f53a0658b6e5e05c71 (patch) | |
tree | 0c7405cc6fcc8d7f1bff832889d84df8577fcf6e /useraddhook | |
parent | c8fe5864c2106fd424b2194ddcd774986cd1640d (diff) | |
download | debvm-da2d22d423c5085cd65f30f53a0658b6e5e05c71.tar.gz |
autologinhook: automatically log in with lightdm
Diffstat (limited to 'useraddhook')
-rwxr-xr-x | useraddhook/customize.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/useraddhook/customize.sh b/useraddhook/customize.sh index 14230a2..d405b72 100755 --- a/useraddhook/customize.sh +++ b/useraddhook/customize.sh @@ -10,6 +10,7 @@ # - requires the passwd and coreutils packages installed inside the chroot # - adds the new user to the sudo group if it exists # - ~/.ssh/authorized_keys files is copied from root user if it exists +# - enables immediate autologin via lightdm if installed # # Example usage: # @@ -34,3 +35,10 @@ if [ -e "$1"/root/.ssh/authorized_keys ]; then chroot "$1" install -o "$USERNAME" -g "$USERNAME" -m 700 -d "/home/$USERNAME/.ssh" chroot "$1" install -o "$USERNAME" -g "$USERNAME" -t "/home/$USERNAME/.ssh" /root/.ssh/authorized_keys fi +if [ -e "$1/etc/lightdm/lightdm.conf" ]; then + cat >>"$1/etc/lightdm/lightdm.conf" <<EOF +[SeatDefaults] +autologin-user=$USERNAME +autologin-user-timeout=0 +EOF +fi |