I am setting up a server to be able to support SSH with host key authentication which is currently handled by an old dying server. As of right now I can successfully connect with SSH and interact in the terminal like normal. However if I include a command or put the SSH in an RSync command I get the error "Host key verification failed".
So this command works:
ssh -o StrictHostKeyChecking=no -i /cygdrive/C/keys/id_rsa firstname.lastname@example.org
While the following does not:
ssh -o StrictHostKeyChecking=no -T -i /cygdrive/C/keys/id_rsa email@example.com ssh 192.168.0.2 mkdir -p /mnt/storage/new_folder
However they both work when pointing to the older server, so the commands themselves should be fine. Additionally if I can manage to not change the commands it would allow us to be backwards compatible.
I'm including the sshd_config settings on the new server (which were set to mimic the old server) below in case they help, the only items here are the ones that were not commented out.
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
New server is Ubuntu 17.10 (will be updated to LTS when next one comes out soon). Old server is Debian 6.0.6.
Edit: Forgot to mention, this error is also occurring when I use RSync with '-e'. However I found that in the RSync command, I can fix the issue by using
firstname.lastname@example.org:/mnt/storage/new_folder in the remote path parameter. If I remove "username@" then I get the error again. Again, the failing version works fine on the old serve, only fails with new server. Also keep in mind this is legacy code, so if I can get the old commands to work as-is it'll save me a bunch of time pushing updates.