Re: Remote command execution failed: Permission denied,pleas
Posted: Thu Jun 12, 2014 7:37 am
Post output here of error when su - nagios
Support for Nagios products and services
https://support.nagios.com/forum/
i hope!!!Your problem is going to solve in coming posts
when i try to use the command su - nagios...... nothing happens!!Post output here of error when su - nagios
Code: Select all
root@maestro:~# su - nagios
root@maestro:~#
Code: Select all
id nagios
uid=121(nagios) gid=124(nagios) groups=124(nagios)
Code: Select all
ls -l /usr/local/nagios/libexec/check_nagios
Code: Select all
getent passwd nagios
Forums ate my first response - I had to re-type it (although it may have been a Layer 8 problem here).
ok on my remote server backups:Firstly - make sure the plugin you're executing on the remote server has the execute bit set:
Code: Select all
root@backups:/usr/local/nagios/etc# ls -l /usr/local/nagios/libexec/check_nagios-rwxr-xr-x 1 nagios nagios 124350 mag 19 12:02 /usr/local/nagios/libexec/check_nagios
Code: Select all
root@maestro:/usr/lib/nagios/plugins# getent passwd nagios
nagios:x:121:124::/var/lib/nagios:/bin/false
Code: Select all
su - nagios -s /bin/bashtry this command
Code: Select all
su - nagios -s /bin/bash
Code: Select all
root@maestro:/usr/lib/nagios/plugins# su - nagios -s /bin/bash
nagios@maestro:~$ Code: Select all
/usr/lib/nagios/plugins/check_by_ssh -4 -H remote address -l root -p 2022 -C "/usr/local/nagios/libexec/check_nagios -t 20 -e 5 -F /usr/local/nagios/var/nagios.log -C /usr/local/nagios/bin/nagios" -vvvvvvvvvvvvvvvvvvvvvCode: Select all
/usr/lib/nagios/plugins/check_by_ssh -H intranet.xx.xx -l root -p 2022 -C "/usr/local/nagios/libexec/check_nagios -t 20 -e 5 -F /usr/local/nagios/var/nagios.log -C /usr/local/nagios/bin/nagios" -vvvvvvvvv Code: Select all
nagios@maestro:~$ /usr/lib/nagios/plugins/check_by_ssh -4 -H intranet.xx.xx -l root -p 2022 -C "/usr/local/nagios/libexec/check_nagios -t 20 -e 5 -F /usr/local/nagios/var/nagios.log -C /usr/local/nagios/bin/nagios" -vvvvvvvvvvvvvvvvvvvvv
Command: /usr/bin/ssh
Argument 1: -4
Argument 2: -l
Argument 3: root
Argument 4: -p
Argument 5: 2022
Argument 6: intranet.xx.xx
Argument 7: /usr/local/nagios/libexec/check_nagios -t 20 -e 5 -F /usr/local/nagios/var/nagios.log -C /usr/local/nagios/bin/nagios
[email protected]'s password:
NAGIOS OK: 41 processes, status log updated 200 seconds ago
nagios@maestro:~$ yes!it will ask password
Code: Select all
[nagios@jtm01~]$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/nagios/.ssh/id_dsa):
Enter passphrase (empty for[b] no passphrase)[/b]:
Enter same passphrase again:
Your identification has been saved in /home/nagios/.ssh/id_dsa.
Your public key has been saved in /home/nagios/.ssh/id_dsa.pub.
The key fingerprint is:
f4:94:48:ef:d8:be:1b:06:11:5f:7a:30:42:ca:08:64 nagios@jtm01
[nagios@jtm01 ~]$ scp -P 2022 /home/nagios/.ssh/id_dsa.pub [email protected]:/root/.ssh/authorized_keys
[email protected]'s password:
id_dsa.pub 100% 602 0.6KB/s 00:00