Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

passing yes argument while scp command

Tags:

I am facing an issue when I run simply these commands.

The remote server want to pass yes to add the key in RSA file because first time connection established with scp.

commands are given below

#!/bin/bash  scp  -P58222 root@IP:/root/K /N /usr/bin/expect -c 'expect "\n" { expect "Are you sure you want to continue connecting (yes/no)?" }' send "yes\r" expect "$ " send "exit\r" 

Actually I have to pass yes in my script while asking

The authenticity of host 'ip address (ip address)' can't be established.

RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx. Are you sure you want to continue connecting (yes/no)?  

Are you sure you want to continue connecting (yes/no)?

how can I get rid of this problem?

with

scp -o  StrictHostKeyChecking=no 

it is still asking.

like image 418
Harry shah Avatar asked Mar 31 '15 16:03

Harry shah


Video Answer


1 Answers

scp -o StrictHostKeyChecking=no root@IP:/root/K  

Obviously, this isn't a very secure solution. Works for one-shots where you're not concerned about man in the middle, though.

like image 91
economy Avatar answered Jan 08 '23 15:01

economy