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 authored and adamruzicka committed Nov 25, 2024
1 parent 1feb571 commit 3a53f66
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ if [ ! -x "$(command -v sudo)" ]; then
$PKG_MANAGER_INSTALL sudo
fi
<% 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 %>
chmod 440 /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
chmod 440 /etc/sudoers.d/<%= ssh_user %>
<% end -%>
Expand Down

0 comments on commit 3a53f66

Please sign in to comment.