Skip to content

Commit

Permalink
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 committed Sep 30, 2024
1 parent 5fdab0f commit 7647ea9
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 600 /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 600 /etc/sudoers.d/<%= ssh_user %>
<% end -%>
<% end -%>
else
Expand Down

0 comments on commit 7647ea9

Please sign in to comment.