Solved

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

Posted on 2011-09-12
5
557 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
  • 2
  • 2
5 Comments
 
LVL 7

Expert Comment

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


StrictHostKeyChecking no
0
 
LVL 28

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 500 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 28

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now