Solved

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

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to get maximum transfer speed over LAN 4 108
How to update  and reset admin password for Linux 5 65
AWS Central Authentication 1 88
Post Clonezilla image restore issue 6 39
I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

820 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