From 551ec22e7b8fe240a111f7124d820ff64299283f Mon Sep 17 00:00:00 2001 From: Tim Sogard Date: Mon, 3 Nov 2014 18:32:21 -0800 Subject: Reset $HOME to user running chef-client when running via sudo --- lib/chef/knife/bootstrap.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb index 64d1d0c378..a4095e8402 100644 --- a/lib/chef/knife/bootstrap.rb +++ b/lib/chef/knife/bootstrap.rb @@ -378,7 +378,7 @@ class Chef 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 -- cgit v1.2.1