Linux – SSHing with the nobody user

freebsdlinuxssh

I am on FreeBSD. Essentially, I am trying to have a php script (run by apache) ssh into another machine. I am running into the problem that nobody does not have a .ssh configuration file and so am getting the error:

Could not create directory '/nonexistent/.ssh'.
Host key verification failed.

Is there a way to work around this? Bonus points if you can do this without root access so I do not need to pay my web hosting company to do this.

Thanks.

Best Answer

Try to start ssh with the following options:

ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ...

That way, ssh doesn't try to load and create the .ssh/known_hosts file.