Skip to content

Commit

Permalink
FIXES #37867 - Fix remote_execution_ssh_keys sudoers permissions
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Fernández Rodríguez <[email protected]>
  • Loading branch information
pafernanr authored and adamruzicka committed Oct 16, 2024
1 parent 53b8b38 commit 477170a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ EOF
<% if @host.operatingsystem.family == 'Redhat' || @host.operatingsystem.family == 'Debian' -%>
echo "<%= ssh_user %> ALL = (root) NOPASSWD : ALL" > /etc/sudoers.d/<%= ssh_user %>
echo "Defaults:<%= ssh_user %> !requiretty" >> /etc/sudoers.d/<%= ssh_user %>
chmod 440 /etc/sudoers.d/<%= ssh_user %>
<% elsif @host.operatingsystem.family == 'Suse' -%>
echo "<%= ssh_user %> ALL = (root) NOPASSWD : ALL" >> /etc/sudoers
echo "Defaults:<%= ssh_user %> !targetpw" >> /etc/sudoers
chmod 440 /etc/sudoers.d/<%= ssh_user %>
<% end -%>
<% end -%>
else
Expand Down

0 comments on commit 477170a

Please sign in to comment.