summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2023-07-22 10:28:15 +0300
committerLars Wirzenius <liw@liw.fi>2023-07-22 10:28:15 +0300
commit65132fa24573261b503a2d5e896aa395b96aaf17 (patch)
tree82c946b78329d544c38a00782d04a67f6fa896e2
parentcd22b0d033a96188ef494ee3c8784659cd7ba62e (diff)
downloadv-i-65132fa24573261b503a2d5e896aa395b96aaf17.tar.gz
feat: allow removing root password
This allows user to log in from console. SSH is configured to not allow login with password in any case. Sponsored-by: author
-rw-r--r--std.yml8
1 files changed, 8 insertions, 0 deletions
diff --git a/std.yml b/std.yml
index 93928be..a335b02 100644
--- a/std.yml
+++ b/std.yml
@@ -14,6 +14,12 @@
- name: "lock root password"
shell: |
passwd -l root
+ when: passwordless_root is not defined or not passwordless_root
+
+ - name: "remove root password"
+ shell: |
+ sed -i '/^root:[^:]*:/s//root::/' /etc/passwd
+ when: passwordless_root
- name: "create ~root/.ssh"
when: user_pub is defined
@@ -134,3 +140,5 @@
user_keyboard_model: pc105
user_keyboard_layout: fi
user_console_codeset: Lat15
+
+ passwordless_root: false