Solved

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

Posted on 2011-09-12
5
625 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 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 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Hello EE, Today we will learn how to send all your network traffic through Tor which is useful to get around censorship and being tracked all together to a certain degree. This article assumes you will be using Linux, have a minimal knowledge of …
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é.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

717 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