I'm using ssh command to remotely executing a shell script with -o **StrictHostKeyChecking=no ** option to bypass the authentification:
ssh -o StrictHostKeyChecking=no root@$IP '/test-script'
However, I'm using a sh shell that does not support the StrictHostKeyChecking=no option:
root:~ Jeff$ ssh StrictHostKeyChecking=no root@$IP '/test-script'
Could not create directory '/home/root/.ssh'.
The authenticity of host '192.168.186.1 (192.168.186.1)' can't be established.
ECDSA key fingerprint is SHA256:KOx9T7VeRy9dJ2ug+tfnlbnG/7Fm0I5Tl/ziTkE4JaE.
Are you sure you want to continue connecting (yes/no)?
All the -o option for ssh I have are:
ssh -o help
ssh: Available options:
ExitOnForwardFailure
UseSyslog
So is there any way I can prompt the 'yes' for the 'Are you sure you want to continue connecting (yes/no)?' question on the remote host?
I tried the following options but none of them worked
ssh -o StrictHostKeyChecking=no root@$IP '/test-script' | yes
yes | ssh StrictHostKeyChecking=no root@$IP '/test-script'
yes yes | ssh StrictHostKeyChecking=no root@$IP '/test-script'
Is there any way I can run the ssh remote command, read the prompt and find this question 'Are you sure you want to continue connecting (yes/no)?' and just enter yes?
Thank you
Assuming this is dropbear's ssh client.
From
man dbclient
This should be the dropbear equivalent to
-o StrictHostKeyChecking=no
.