Solved

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

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
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…
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…
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.
Suggested Courses

737 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