Issues making SSH non-Interactive

I fire the rsyn command as below:

rsync --delay-updates -F --compress --archive -e "/usr/bin/ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"  user1@myhost.server.com:/tmp/jarexplorer-0.7.jar /web/admin/data/

The above command get interpreted as below:

ssh -vvv -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=user1 -o ConnectTimeout=10 myhost.server.com

Output:

I am getting the authenticity prompt despite passing the non-interactive parameters using flag -o

I have added the public key to authorized_keys only and NOT to known_hosts.

 uname -a
Linux myhost.server.com 3.10.0-693.17.1.el7.x86_64 #1 SMP Sun Jan 14 10:36:03 EST 2018 x86_64 x86_64 x86_64 GNU/Linux

Can you please suggest what is wrong with my rsync command ?

If you type 'yes' just once, it will remember that host.

If you are inferring that the ssh part in the rsync command is equivalent to the stand alone ssh command, that is not accurate, they are not equivalent nor synonymous, the options are not the same.

If you do not want to show, the option is StrictHostKeyChecking=no as it shown in the rsync line.

The authenticity of host 'myhost.server.com (101.12.52.70)' can't be established.
ECDSA key fingerprint is ed:b5:db:e8:b5:f2:3f:b3:38:17:1a:ac:b8:02:ba:30.
Are you sure you want to continue connecting (yes/no) 

This output is not about user authentication which KbdInteractiveAuthentication is for. This is about authentication of the host and fingerprint of the host.

1 Like

Is there any option to suppress "ECDSA key fingerprint"

As Aia pointed the option you want is StrictHostKeyChecking= .

Use no or off to automatically add new host keys and allow connections to hosts with changed keys. Use accept-new to automatically add new hosts but not permit hosts with changed keys. ask (the default) to interactively ask the user what to do.

1 Like