Page 1 of 2

SSH backup via GUI

Posted: Thu Dec 13, 2018 5:19 pm
by absarcompass
Hi guys,
I have enable ssh backup from nagiosxi 5.5.7 web interface but it is not authenticating.
I can do ssh and scp from my nagiosxi command line which certainly means that there is no issue of connectivity and authentication
can you suggest what might be causing an issue here

cheers

Re: SSH backup via GUI

Posted: Fri Dec 14, 2018 12:23 pm
by npolovenko
Hello, @absarcompass. Do you see any errors in the following log file?
/usr/local/nagiosxi/var/components/scheduledbackups.log
Also, click on the test authentication button a few times and then upload the /var/log/secure and /var/log/messages from the remote SCP server.

Re: SSH backup via GUI

Posted: Sun Dec 16, 2018 3:54 pm
by absarcompass
Thanks
looks like schedule backup is either not logging or not finding anything worthy of logging
[root@nagiosxi components]# tail -f /usr/local/nagiosxi/var/components/scheduledbackups.log
09-22-2017 05:30:06 DEBUG: Running scheduled FTP backup ...
09-22-2017 05:30:06 DEBUG: Sending create local backup command to CmdSubsystem
09-29-2017 05:30:06 DEBUG: Running scheduled FTP backup ...
09-29-2017 05:30:06 DEBUG: Sending create local backup command to CmdSubsystem
10-06-2017 05:30:06 DEBUG: Running scheduled FTP backup ...
10-06-2017 05:30:06 DEBUG: Sending create local backup command to CmdSubsystem
10-13-2017 05:30:06 DEBUG: Running scheduled FTP backup ...
10-13-2017 05:30:06 DEBUG: Sending create local backup command to CmdSubsystem
10-20-2017 05:30:06 DEBUG: Running scheduled FTP backup ...
10-20-2017 05:30:06 DEBUG: Sending create local backup command to CmdSubsystem

in addition to that secure/auth log has the below with nothing in messages
(I have removed IP address from log)
Dec 17 09:25:23 sshd[975]: Received disconnect from x.x.x.x port 58531:11: PECL/ssh2 (http://pecl.php.net/packages/ssh2) [preauth]
Dec 17 09:25:23 sshd[975]: Disconnected from authenticating user nagiosxi x.x.x.x port 58531 [preauth]
Dec 17 09:25:23 sshd[977]: Received disconnect from x.x.x.x port 58532:11: PECL/ssh2 (http://pecl.php.net/packages/ssh2) [preauth]
Dec 17 09:25:23 sshd[977]: Disconnected from authenticating user nagiosxi x.x.x.x port 58532 [preauth]
Cheers!

Re: SSH backup via GUI

Posted: Mon Dec 17, 2018 2:54 pm
by npolovenko
@absarcompass, Does the login or password to the remote FTP server contain any special characters? If so please try temporarily changing the password to something simple with no special characters. Let me know if the authentication starts working.
Also, you tried to ssh/scp from the command line, right? Now please sign in as the nagios user and try the same commands again:
su - nagios
Finally, please update to the latest version of XI -> 5.5.8.

Re: SSH backup via GUI

Posted: Mon Dec 17, 2018 7:50 pm
by absarcompass
Hi
it didn't work with even simpler password from web interface
ssh worked from user nagios to remote server,

Re: SSH backup via GUI

Posted: Tue Dec 18, 2018 5:45 pm
by ssax
Did you test like this?

Code: Select all

su - nagios
ssh [email protected]
Does it prompt you with this still or did it store it already?

Code: Select all

The authenticity of host '192.168.X.X (192.168.X.X)' can't be established.
ECDSA key fingerprint is SHA256:cak0s3xE/fYTjxTSyFROsMHvWAWUmmEd7IUr+HSE8iU.
ECDSA key fingerprint is MD5:22:13:2a:43:a6:11:44:57:ed:c4:c5:56:b7:41:87:64.
Are you sure you want to continue connecting (yes/no)?

Re: SSH backup via GUI

Posted: Tue Dec 18, 2018 6:00 pm
by absarcompass
Hi ssax,
it wasn't but now it is already saved
does web gui has a different user for apache or php? it should work if it is working from command line

Re: SSH backup via GUI

Posted: Wed Dec 19, 2018 5:51 pm
by ssax
Should run as apache user.

Are you using a DNS name for the hostname or an IP address? If you're using a hostname, please try using the IP address and see if that works.

Do you see any errors in /var/log/httpd/error_log or in /var/log/httpd/ssl_error_log on the XI server when you click the Test Connection button?

You can run this tail command and then hit the test button to see if anything is output:

Code: Select all

tail -F /var/log/httpd/error_log /var/log/httpd/ssl_error_log

Re: SSH backup via GUI

Posted: Thu Dec 20, 2018 3:11 pm
by absarcompass
Hi ssax,
No, the hostname is ip address
there are logs only in /var/log/httpd/error_log
==> /var/log/httpd/error_log <==
[Fri Dec 21 08:57:48 2018] [error] [client 192.168.222.253] PHP Warning: ssh2_auth_password(): Authentication failed for nagiosxi using password in /usr/local/nagiosxi/html/includes/components/scheduledbackups/ajaxcalls.php on line 0, referer: http://nagiosxi.compassnet.co.nz/nagios ... ackups.php
[Fri Dec 21 08:59:14 2018] [error] [client 192.168.222.253] PHP Warning: ssh2_auth_password(): Authentication failed for nagiosxi using password in /usr/local/nagiosxi/html/includes/components/scheduledbackups/ajaxcalls.php on line 0, referer: http://nagiosxi.compassnet.co.nz/nagios ... ackups.php
Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done
[Fri Dec 21 09:02:16 2018] [error] [client 192.168.222.253] PHP Warning: ssh2_auth_password(): Authentication failed for nagiosxi using password in /usr/local/nagiosxi/html/includes/components/scheduledbackups/ajaxcalls.php on line 0, referer: http://nagiosxi.compassnet.co.nz/nagios ... ackups.php
But the same username and password with same port is authenticating in remote server from command line,

Re: SSH backup via GUI

Posted: Fri Dec 21, 2018 3:23 pm
by npolovenko
@absarcompass, Please sign in to the ssh backup server and open the following file:
/etc/ssh/sshd_config
Let me know if PasswordAuthentication is set to yes or no.

Also, when you ran the ssh command from the command line, did it ask you for a password or no?