Sponsored Content
Top Forums Shell Programming and Scripting Need Help ssh key fail on remote server Post 302980746 by stomp on Thursday 1st of September 2016 07:49:16 PM
Old 09-01-2016
Something like this...

Code:
for server in $(cat server_list);do
  {
  # set a different connect and command timeout ( you probably want to know the difference 
  # between an unreachable server and an unconfigured keybased authentication)
  output=$(timeout 10 ssh -o ConnectTimeout=8 $server ps -ef \| grep [z]abbix)
  code=$?
  if [ $code -ne 124 ]; then # return code 124 is the code when timeout has been reached
   echo "$server auth ok::$code::$output"
 else
   echo "$server auth failed" 
 fi
 } # Add a & before the # if you want to have all ssh connections started in parallel
done >zab_chk_output.txt
wait


Last edited by stomp; 09-02-2016 at 04:53 PM.. Reason: Removed unecessary { ... }
This User Gave Thanks to stomp For This Post:
 

10 More Discussions You Might Find Interesting

1. Cybersecurity

SSH key code versus server key code

Hi, When logging in using SSH access (to a remotely hosted account), I received a prompt to accept a server's key fingerprint. Wrote that string of code down for comparision. Already emailed my host for their listing of the string of code for the server's key fingerprint (for comparison,... (1 Reply)
Discussion started by: Texan
1 Replies

2. Shell Programming and Scripting

Generate Public Key when the server is not ssh enabled

I am writing a script that needs to access various servers some of which are not ssh enabled. In order to access the ssh enabled servers I am using the following command to generate the public key : ssh-keygen -t rsa Is there a similar command for the other servers as well. If I try to use... (1 Reply)
Discussion started by: ravneet123
1 Replies

3. Shell Programming and Scripting

Using ssh to add register key on ssh server

Hi, I want to use ssh to add a register key on remote ssh server. Since there are space characters in my register key string, it always failed. If there is no space characters in the string, it worked fine. The following is what I have tried. It seems that "ssh" command doesn't care about double... (9 Replies)
Discussion started by: leaftree
9 Replies

4. Shell Programming and Scripting

how to ssh to remote unix machines using private/public key

hello, iam able to ssh to a linux server from a linux server called "machine1" using the private/public key method, so I dont need to enter any password when I run my script but iam not able to ssh from machine1 to a UNIX server, access is denied. note that I am using an application id which is... (6 Replies)
Discussion started by: wydadi
6 Replies

5. AIX

ssh public key auth "Remote login for account is not allowed" ?

Hello, Using AIX 6.1 boxes. User user1 connects from box A to box B using ssh. When password authentication is used everything is fine. When I configure user1 to use public key authentication sftp client works fine(no password asked), but ssh client fails. This is sshd log: Accepted publickey... (3 Replies)
Discussion started by: vilius
3 Replies

6. Solaris

Solaris 8 ssh public key authentication issue - Server refused our key

Hi, I've used the following way to set ssh public key authentication and it is working fine on Solaris 10, RedHat Linux and SuSE Linux servers without any problem. But I got error 'Server refused our key' on Solaris 8 system. Solaris 8 uses SSH2 too. Why? Please help. Thanks. ... (1 Reply)
Discussion started by: aixlover
1 Replies

7. Shell Programming and Scripting

Auto Remote SSH key setup

Hi Guys!! I am trying to get around the complex situation, i have a task to complete, Like to setup the remote SSH key automatically by providing the root login details, ip and ssh port once to the script input and once its tested and accepted the next ssh should be password less, script... (0 Replies)
Discussion started by: SilvesterJ
0 Replies

8. IP Networking

Cygwin remote ssh with key authentication method

Hi experts, I am not sure in which forum to submit this question. If this is not the correct place then please let me know where to submit this thread. My requirement is to invoke windows batch scripts from linux shell script. Hence, I have installed openssh in Cygwin on the windows machine.... (2 Replies)
Discussion started by: ahmedwaseem2000
2 Replies

9. 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

10. Solaris

Remote Ssh Fail

Hi, I'm getting error when try to remote using ssh. I already check and ssh service is online. Does solaris 11 sparc need to do other setting. Error is interactive keyboard failed. Please assist me. Thanks. ---------- Post updated at 10:25 PM ---------- Previous update was at 08:49 PM... (0 Replies)
Discussion started by: mzainal
0 Replies
roar_connect(3) 					System Manager's Manual: RoarAudio					   roar_connect(3)

NAME
roar_connect, roar_connect2 - connects to RoarAudio's sound server SYNOPSIS
#include <roaraudio.h> int roar_connect(struct roar_connection * con, char * server); int roar_connect2 (struct roar_connection * con, char * server, int flags, uint_least32_t timeout); DESCRIPTION
Connects to RoarAudio's sound server. This calls just connects to the sound server without any authentication or identify. Do not use this from end user applications. Use roar_simple_connect(3) or roar_simple_connect2(3). PARAMETERS
con The connection object to be filled with the data needed to talk to the server used by nearly all other calls. server The server to connect to. flags Flags used to connect to the server. Currently only ROAR_ENUM_FLAG_NONE and ROAR_ENUM_FLAG_NONBLOCK are supported. ROAR_ENUM_FLAG_NONBLOCK disables some of the server location features. timeout Timeout for the connection. A value of zero means no timeout. Currently timeouts are not supported. RETURN VALUE
On success these calls return 0. On error, -1 is returned. EXAMPLES
See libroar/simple.c, roar_simple_connect(3). SEE ALSO
roar_simple_connect(3), libroar(7), RoarAudio(7). RoarAudio May 2011 roar_connect(3)
All times are GMT -4. The time now is 07:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy