Skip to content

Commit

Permalink
Fixes #38030 - Allow remote execution become any user.
Browse files Browse the repository at this point in the history
  • Loading branch information
vhsantos committed Nov 21, 2024
1 parent e685987 commit 0cd370b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%>
Expand Down

0 comments on commit 0cd370b

Please sign in to comment.