new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / debian / ossec-hids / var / ossec / agentless / ssh_nopass.exp
1 #!/usr/bin/env expect
2
3 # Agentless monitoring
4 #
5 # Copyright (C) 2009 Trend Micro Inc.
6 # All rights reserved.
7 #
8 # This program is a free software; you can redistribute it
9 # and/or modify it under the terms of the GNU General Public
10 # License (version 2) as published by the FSF - Free Software
11 # Foundation.
12
13 expect {
14     "WARNING: REMOTE HOST" {
15         send_user "\nERROR: RSA host key for '$hostname' has changed. Unable to access.\n"
16         exit 1;
17     }
18     "*sure you want to continue connecting*" {
19         send "yes\r"
20         source $sshnopasssrc
21         return
22     }
23     "ssh: connect to host*" {
24         send_user "\nERROR: Unable to connect to remote host: $hostname .\n"
25         exit 1;
26     }
27     "no address associated with name" {
28         send_user "\nERROR: Unable to connect to remote host: $hostname .\n"
29         exit 1;
30     }
31     "*Connection refused*" {
32         send_user "\nERROR: Unable to connect to remote host: $hostname .\n"
33         exit 1;
34     }
35     "*Connection closed by remote host*" {
36         send_user "\nERROR: Unable to connect to remote host: $hostname .\n"
37         exit 1;
38     }
39     "* password:*" {
40         send_user "\nERROR: Public key authentication failed to host: $hostname .\n"
41         exit 1
42     }
43     "*\\\$" {
44         send_user "\nINFO: Started.\n"
45     }
46     "*#" {
47         send_user "\nINFO: Started.\n"
48     }
49     timeout {
50         send_user "\nERROR: Timeout while connecting to host: $hostname . \n"
51         exit 1;
52     }
53 }