How do I automate this in bash?
I'm trying to find a way to do this in a bash script instead of manually typing 'yes' when ssh asks:
Code:
$ ssh `hostname` # enter "yes"
$ exit
$ ssh localhost # enter "yes"
$ exit
I tried this, but it didn't work:
Code:
echo "yes\nexit\n" > $(ssh `hostname`)
It still waits here for me to type something:
Code:
The authenticity of host 'myhost (10.1.2.3)' can't be established.
RSA key fingerprint is 32:5d:aa:67:1f:76:bb:68:dd:d2:79:39:cc:21:ee:e0.
Are you sure you want to continue connecting (yes/no)?
Any ideas?