Operating System - HP-UX
1833465 Members
2764 Online
110052 Solutions
New Discussion

executing commands using ssh protocol- message is coming

 
ManojKumar
Advisor

executing commands using ssh protocol- message is coming

Hi all,

Following message is coming when i am going to login a device using ssh protocol .

It is coming first time only .

Message ::

The authenticity of host '192.*.*.* (192.*.*.*)' can't be established.
RSA key fingerprint is 14:15:0f:e1:1b:8d:d6:ed:5b:cd:f5:30:1f:a2:49:c2.
Are you sure you want to continue connecting (yes/no)?



Through my program i am not able to provide "yes" or "no"- (i am working on .net platform)

Problem:
How to get rid of this message .
If it is possible to ignore this message then plz let me know the same .

regards,
manoj
8 REPLIES 8
TwoProc
Honored Contributor

Re: executing commands using ssh protocol- message is coming

Log in manually (just once) and agree to the question, it will be stored in the ~/.ssh/hosts file for you, and shouldn't come up as a question again, unless the IP address changes for that host name.
We are the people our parents warned us about --Jimmy Buffett
Patrick Wallek
Honored Contributor

Re: executing commands using ssh protocol- message is coming

You will need to ssh from command line and acknowledge the message first. After you do that you will not receive that question any more.
ManojKumar
Advisor

Re: executing commands using ssh protocol- message is coming

Hi all,

Thanks for a quick response .

First of all i want to tell you that i have to do everything using a .Net(c#) program- i can't enter "yes" manually .

Copying public keys to the known_hosts file is enough or not - i m not sure about that- .

Can't we ignore or bypass this message .

regards,
Patrick Wallek
Honored Contributor

Re: executing commands using ssh protocol- message is coming

There is no way I know of to bypass that message.

You only have to acknowledge that message the FIRST time you connect to a machine. After that it will not show up again.

I think you must find some way to initially connect via ssh from a command line so you can respond yes.
Sandman!
Honored Contributor

Re: executing commands using ssh protocol- message is coming

Hi Manoj,

You can't ignore or bypass this message, however you can provide an automated response by using an expect wrapper script. You can get expect from...http://expect.nist.gov/

cheers!
Greg Vaidman
Respected Contributor

Re: executing commands using ssh protocol- message is coming

If you can't respond to this message, then you need to manually populate your $HOME/.ssh/known_hosts file, prior to making the first connection to the host. One way to do this is with the ssh-keyscan utility. From the manpage:

ssh-keyscan is a utility for gathering the public ssh host keys of a
number of hosts. It was designed to aid in building and verifying
ssh_known_hosts files. ssh-keyscan provides a minimal interface
suitable for use by shell and perl scripts.

ssh-keyscan uses non-blocking socket I/O to contact as many hosts as
possible in parallel, so it is very efficient. The keys from a domain
of 1,000 hosts can be collected in tens of seconds, even when some of
those hosts are down or do not run ssh. For scanning, one does not
need login access to the machines that are being scanned, nor does the
scanning process involve any encryption.
Greg Vaidman
Respected Contributor

Re: executing commands using ssh protocol- message is coming

By the way, ssh-keyscan comes with the HP distribution of ssh. If it isn't included in your windows distribution, you can run it on your HP-UX box, then copy the known_hosts file. Hopefully, your Windows distribution is based on OpenSSH like HP's, so the file format is identical...

Good Luck!
--Greg
Steven Mertens
Trusted Contributor

Re: executing commands using ssh protocol- message is coming

Hello,

You can put the following in your local
ssh client config file.

echo "StrictHostKeyChecking no" >> {HOME}/.ssh/config

Or you can also add this to /etc/ssh/ssh_config .

Also see man ssh_config and look after
StrictHostKeyChecking.

Rgds.

S.