Skip to content

Commit

Permalink
Fixes #38095 - don't chown /root during ssh key setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ianballou authored and adamruzicka committed Dec 17, 2024
1 parent bb08909 commit 1289673
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ EOF
chmod 0700 <%= ssh_path %>
chmod 0600 <%= ssh_path %>/authorized_keys
chown -R <%= "#{ssh_user}:" %> <%= ssh_path %>
<% if ssh_user != 'root' -%>
chown -R <%= "#{ssh_user}:" %> <%= "~#{ssh_user}" %>
<% end -%>

# Restore SELinux context with restorecon, if it's available:
command -v restorecon && restorecon -RvF <%= ssh_path %> || true
Expand Down

0 comments on commit 1289673

Please sign in to comment.