Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default user_known_hosts_file in ssh connect option should be nil instead of '/dev/null' #740

Open
lytao opened this issue Oct 20, 2022 · 0 comments

Comments

@lytao
Copy link

lytao commented Oct 20, 2022

Hello,

I see knife bootstrap failed fingerprint verification even it is in my ~/.ssh/know_hosts file all the time:

The authenticity of host 'mytestserver (10.0.0.2)' can't be established.
fingerprint is SHA256:sMHpDhHtkcLG9S767Z8sOcTn3hL5N4Zhe40S7P48co8.

When I read into the code I see the option user_known_hosts_file is set default /dev/null in lib/train/transports/ssh.rb. It is not working because of the code slice in Net::SSH:

net-ssh/blob/master/lib/net/ssh/known_hosts.rb#L134

 files += Array(options[:user_known_hosts_file] || %w[~/.ssh/known_hosts ~/.ssh/known_hosts2]) if which == :all || which == :user

The file ~/.ssh/known_hosts never get chance to be loaded unless the user_known_hosts_file is set nil or false (nil is preferrable).

Could you please fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant