Skip to content

Commit

Permalink
Reset $HOME to user running chef-client when running via sudo
Browse files Browse the repository at this point in the history
  • Loading branch information
drags authored and btm committed Mar 27, 2015
1 parent 7a6df30 commit 551ec22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/chef/knife/bootstrap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def ssh_command
command = render_template

if config[:use_sudo]
command = config[:use_sudo_password] ? "echo '#{config[:ssh_password]}' | sudo -S #{command}" : "sudo #{command}"
command = config[:use_sudo_password] ? "echo '#{config[:ssh_password]}' | sudo -SH #{command}" : "sudo -H #{command}"
end

command
Expand Down

0 comments on commit 551ec22

Please sign in to comment.