From 0cd370b79e36101de369a36de3eb1b0c82090879 Mon Sep 17 00:00:00 2001 From: VHS Date: Thu, 4 Jul 2024 12:43:41 +0200 Subject: [PATCH] Fixes #38030 - Allow remote execution become any user. --- .../snippet/remote_execution_ssh_keys.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/unattended/provisioning_templates/snippet/remote_execution_ssh_keys.erb b/app/views/unattended/provisioning_templates/snippet/remote_execution_ssh_keys.erb index cd5c2e0fe8a..0a06ca45737 100644 --- a/app/views/unattended/provisioning_templates/snippet/remote_execution_ssh_keys.erb +++ b/app/views/unattended/provisioning_templates/snippet/remote_execution_ssh_keys.erb @@ -59,10 +59,10 @@ EOF <% if ssh_user != 'root' && host_param('remote_execution_effective_user_method') == 'sudo' -%> <% if @host.operatingsystem.family == 'Redhat' || @host.operatingsystem.family == 'Debian' -%> -echo "<%= ssh_user %> ALL = (root) NOPASSWD : ALL" > /etc/sudoers.d/<%= ssh_user %> +echo "<%= ssh_user %> ALL = (ALL) NOPASSWD : ALL" > /etc/sudoers.d/<%= ssh_user %> echo "Defaults:<%= ssh_user %> !requiretty" >> /etc/sudoers.d/<%= ssh_user %> <% elsif @host.operatingsystem.family == 'Suse' -%> -echo "<%= ssh_user %> ALL = (root) NOPASSWD : ALL" >> /etc/sudoers +echo "<%= ssh_user %> ALL = (ALL) NOPASSWD : ALL" >> /etc/sudoers echo "Defaults:<%= ssh_user %> !targetpw" >> /etc/sudoers <% end -%> <% end -%>