SSH Remote Server issue


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SSH Remote Server issue
# 1  
Old 05-20-2008
SSH Remote Server issue

I have a script that connects to remote servers using a public key. Some of the servers are not set up for the public key and I receive the following when I attempt to ssh: The authenticity of host 'XXX' can't be established.
RSA key fingerprint is C4:6e:7e:37:38:3d:3a:0c:c1:42:d5:86:36:5f:b8:19.
Are you sure you want to continue connecting (yes/no)?


Is there anything I can put around my ssh so that when I receive this, I can just abort the attempt to connect?
# 2  
Old 05-20-2008
That's because the server you try to connect to is not in your known_hosts file. I am not aware of a command that could check the existence of a host in that file other greping the file.

Edit:
try the option -F of the ssh-keygen command.

$ ssh-keygen -F hostname

Last edited by ripat; 05-20-2008 at 04:22 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Issue in executing cat (remote ssh)

Hi, I need to ssh remotely to a machine and cat a file assign the value to a variable Script: #!/bin/bash -x value=`cat config.txt` echo "$value" ssh me@xxx.host.com "valu='cat /export/home/test.md5'; echo "$valu"" | tee Execution: $ ./x ++ cat config.txt + value='touch me' +... (5 Replies)
Discussion started by: close2jay
5 Replies

2. Shell Programming and Scripting

Multi server access through remote server using ssh

Team, Presently I have 5 ip address kept in ip_abc1 file, for each of the ip address listed, i need to login on each ipaddress one at a time and login as below for that specific ip address ssh -p 8101 karaf@<ip.address_for the specific ip address as logged in> password features:list... (4 Replies)
Discussion started by: whizkidash
4 Replies

3. UNIX for Advanced & Expert Users

Unable to ssh to remote server

Hi, I have two SunOs sparc servers mac1 and mac2. I have exchanged keys between them inorder to passwordless login ssh from mac1 to mac2. However, it is failing after authentication. Part of the debug is as below. Please suggest whats wrong and how do i fix that!! Note: i do not have... (1 Reply)
Discussion started by: mohtashims
1 Replies

4. Shell Programming and Scripting

Script to ssh to remote server

Hi All, I need to prepare a script. Description: Currently i am in server "x(ubuntu os)", here i need to develop a script to ssh to another server "y(ubuntu os)", i have password less authentication to "y". i have done the below #!/bin/bash #ssh to the server "y" and confirming i am... (2 Replies)
Discussion started by: kumar85shiv
2 Replies

5. Shell Programming and Scripting

Ssh to remote server loop is breaking

hi All, cat login.list server1 userid1 server2 userid2 server3 userid3 ---------------------------------------- #SSHSCRIPT.ksh FILE=login.list while read vah vah_id do ssh $vah -l $vah_id "pwd" done < "$FILE" ----------------------------------------- When i... (2 Replies)
Discussion started by: raghur77
2 Replies

6. Ubuntu

ssh connection unstable on remote server

Hi I hope someone can spot what is wrong with this ssh connection as it has me baffled. I am trying to set up a remote ssh connection (passwordless) to a remote 'server', (Ubuntu laptop at home). I have tried these steps with rsa and dsa key types, (currently dsa) - 1) ssh-keygen... (4 Replies)
Discussion started by: steadyonabix
4 Replies

7. Red Hat

unable to connect remote server using ssh

hi all i am unable to connect remote server using ssh but i am able to ping the server ssh service is running. (5 Replies)
Discussion started by: nikhil kasar
5 Replies

8. Shell Programming and Scripting

ssh text into file on remote server

Hello, I have about 90 servers that I need to update snmp configs. I am trying to write a script that will echo 4 new lines of text into the snmpd.conf file. I have tested it locally and it works when the server ssh into itself but when I try to run the script to ssh into a remote server it logs... (5 Replies)
Discussion started by: mr_dthomas
5 Replies

9. UNIX for Dummies Questions & Answers

Is it possible for a server to be both a remote and client SSH host?

Hi, Not sure if this is possible, I have a server (SERVER1) that is currently set up as a remote SSH host. My client SSH host (SERVER2) is connecting to SERVER1 to scp a file with no password. I now have a need to set up a third server (SERVER3) as a remote SSH host and I need SERVER1 as a... (4 Replies)
Discussion started by: tatchel
4 Replies
Login or Register to Ask a Question