diff --git a/roles/sysconfig/tasks/main.yml b/roles/sysconfig/tasks/main.yml
index 2e6475b79b84da9f56bbc0c2491d58f65997d27e..ff01b52f6f259cc78ece2cf19449c59dec30acc2 100644
--- a/roles/sysconfig/tasks/main.yml
+++ b/roles/sysconfig/tasks/main.yml
@@ -99,7 +99,7 @@
 - name: enable root login via ssh with key
   ansible.builtin.replace:
     dest: /etc/ssh/sshd_config
-    regexp: ^#PermitRootLogin (yes|without-password|prohibit-password)
+    regexp: ^#?PermitRootLogin.*
     replace: PermitRootLogin without-password
   notify: restart sshd