Host key verification failed even though known_hosts is correct

699 views Asked by At

I am running a Debian 7 Wheezy server and are having problems with connecting to other servers over SSH. This problem only occurs while running SSH through crontab, and not otherwise (logged in as the same user of course).

While running a ssh command as this user through crontab, I get the following problem:

Host key verification failed.

I have removed the ~/.ssh/known_hosts file and manually connected to the server in order for the host key to be correct.

When running SSH with the -v flag, I get the following:

debug1: read_passphrase: can't open /dev/tty: No such device or address
Host key verification failed.

If i list /dev/tty it has 666 permissions:

crw-rw-rw- 1 root root 5, 0 Jun 21 15:49 /dev/tty

I have also manually set the permissions to 666 after I listed /dev/tty in order to be entirely sure.

Why does SSH say it can't read /dev/tty? I've been exploring this for weeks and havn't found an answer. Does anyone have a clue?

0

There are 0 answers