[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2011-09-12
5
Medium Priority
?
725 Views
Last Modified: 2012-05-12
Hi,

On Red Hat Enterprise Linux Server release 5.4 (Tikanga),
I am trying to create a script that will automatically install software on a remote server.
I have it's root password and there are no security issues.
When I run the ssh/scp commands I get the question in the title.
I am looking for a way to automatically acknowledge this question

My code looks somthing like this:

ssh-keygen -R ${DG_NODE}
rm -rf  ~root/.ssh/id_rsa*                                            
alias scp='scp -o StrictHostKeyChecking=no -o BatchMode=yes '
ssh-keygen -q -t rsa -f aaa -N "" -f ~root/.ssh/id_rsa
scp ~root/.ssh/id_rsa.pub root@${DG_NODE}:~root/.ssh/authorized_keys

Using the -o UserKnownHostsFile=/dev/null  option did not help as well.
Thanks
0
Comment
Question by:peledc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 7

Expert Comment

by:jackiechen858
ID: 36525547
Edit /etc/ssh/ssh_config:


StrictHostKeyChecking no
0
 
LVL 29

Expert Comment

by:Jan Springer
ID: 36525564
If you have copied the public key over and performed a manual ssh or scp using that from/to account, then you shouldn't be asked again unless the keys change.
0
 
LVL 21

Accepted Solution

by:
Papertrip earned 2000 total points
ID: 36525958
Without a known_hosts key, no special options:
[user@phxbastion1 ~]$ ssh den1mmail3.den.domain.com
The authenticity of host 'den1mmail3.den.domain.com (10.191.15.226)' can't be established.
RSA key fingerprint is 9e:e6:c7:a6:ab:33:00:29:2a:bd:fa:67:6d:27:39:a6.
Are you sure you want to continue connecting (yes/no)?

Open in new window

Without a known_hosts key, but with special options:
[user@phxbastion1 ~]$ ssh den1mmail3.den.domain.com -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
Warning: Permanently added 'den1mmail3.den.domain.com,10.191.15.226' (RSA) to the list of known hosts.
user@den1mmail3.den.domain.com's password:

Open in new window

0
 
LVL 29

Expert Comment

by:Jan Springer
ID: 36525996
known_hosts gets automatically updated with each new connection.  The author should not have to manually modify that file.
0
 
LVL 21

Expert Comment

by:Papertrip
ID: 36526063
known_hosts gets automatically updated with each new connection.  The author should not have to manually modify that file.

I don't think anyone is suggesting that.
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question