summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornikhil2611 <nikhilgupta2102@gmail.com>2023-03-15 14:27:00 +0530
committernikhil2611 <nikhilgupta2102@gmail.com>2023-03-15 14:27:00 +0530
commit54e9be16e0e2e6a65471133a3f7c28c1d9d8688f (patch)
tree2d8182c3237e998bc238d0f1ab1c61461224e0c9
parent861301d5b8aebbe1fbfb88d48143dbc10f60162f (diff)
downloadchef-54e9be16e0e2e6a65471133a3f7c28c1d9d8688f.tar.gz
updated the non_interactive to false when RequestTTY set to yes
Signed-off-by: nikhil2611 <nikhilgupta2102@gmail.com>
-rw-r--r--knife/lib/chef/knife/bootstrap.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/knife/lib/chef/knife/bootstrap.rb b/knife/lib/chef/knife/bootstrap.rb
index 3b3627866a..eea11b3b6f 100644
--- a/knife/lib/chef/knife/bootstrap.rb
+++ b/knife/lib/chef/knife/bootstrap.rb
@@ -950,7 +950,8 @@ class Chef
opts = {}
return opts if winrm?
- opts[:non_interactive] = false # Prevent password prompts from underlying net/ssh
+ ssh_config_file = File.open(File.join(Dir.home, ".ssh/config")).read
+ ssh_config_file.include?("RequestTTY yes") ? opts[:non_interactive] = false : opts[:non_interactive] = true # Prevent password prompts from underlying net/ssh
opts[:forward_agent] = (config[:ssh_forward_agent] === true)
opts[:connection_timeout] = session_timeout
opts