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

Fatal error: Host key verification failed. #59

Open
Calvin92 opened this issue Sep 30, 2017 · 7 comments
Open

Fatal error: Host key verification failed. #59

Calvin92 opened this issue Sep 30, 2017 · 7 comments

Comments

@Calvin92
Copy link

Hi, I am confused about this error, can u spare some time to help me?

const FTPS = require('ftps')
const ftps = new FTPS({
	host: '192.168.xx.xx',
	username: 'xx',
	password: 'xx',
	protocol: 'sftp',
	port: 22,
})

ftps.cd('/export/wxsq/resource/fd/h5/for-fonts-server').addFile(__dirname + '/aa.css').exec(console.log);

Error:

null { error: 'cd: Fatal error: Host key verification failed.\r\nput: /Users/ruanjiawei/Desktop/ftptest/aa.css: Fatal error: Host key verification failed.\r\n',
  data: '' }
@Calvin92
Copy link
Author

Anything wrong with Host key ?

@verils
Copy link

verils commented Jan 31, 2018

I have this problem too. I don't understand why I can use lftp to connect sftp server directly with only my username & password, but just can't connect it when I run my node script without a ssh key?

@hardy925
Copy link

@verils are you running the script on only your machine? are you able to $ ssh user@ip via terminal?

@verils
Copy link

verils commented Jan 31, 2018

@shardy613 I haven't tried to run that script on other machines yet. And, I can run $ ssh user@ip to connect server successfully, just the terminal gives me a hint:

The authenticity of host 'xxx' can't be established.
RSA key fingerprint is SHA256:xxxxxxxx.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/xxx/.ssh/known_hosts).

I doesn't seem to make any effect.

@hardy925
Copy link

hardy925 commented Jan 31, 2018

Ok, you're inputting yes and getting the error? are you root on the machine? what os are you, this seems like a permission issue, Failed to add the host to the list of known hosts (/home/xxx/.ssh/known_hosts). The machine you are connecting to with the script should first be added to the known_hosts file.

@verils
Copy link

verils commented Jan 31, 2018

I use Windows7 for now, and run the terminal as admin.

I mean, when I input yes, though it gave me a hint like that, but it made no effect, I can still login into server.

I just tried ssh again and input no, and got Host key verification fail finally. Now I see, maybe running my script the low level functions answered a no automatically for me?And it just need a retry?:-)
That's all I guess.

@ufon
Copy link

ufon commented Sep 21, 2018

set 'autoConfirm: true' in config. that's helped me

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

4 participants