Nagios user on centos
Nagios user on centos
I don't remember setting the password for the nagios user on the server when installing Nagios core. Can I change the nagios user password to something else without breaking anything for nagios
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios user on centos
I think I must of set one then. This is what I get when I do a su nagios
then I just press enter and I get the su: Authentication failure. So I guess I should be able to reset it without a problem. I am trying to ssh to the centos server with the nagios user account.
Code: Select all
[alan@Svr-Monitor nagios]$ su nagios
Password:
su: Authentication failure
[alan@Svr-Monitor nagios]$Re: Nagios user on centos
So right now I use VC Code to ssh into the Nagios server that is CentOS 7 I created an account that I use for that. So I have been trying to edit the .cfg file in VS code it self without having to open VIM.
If I take ownership of the all the files it works fine but when I tried to add a new switch to the Nagios UI or make a change it did not take the changed. Do I switched back ownership to the nagios user. Now I SSHed to the server as the nagios user through VS Code and again I can now edit the file in VS Code but when I run /etc/rc.d/init.d/nagios reload it gives me errors. So I do su alan then try to reload it I get errors. So I close the ssh session and open another one with the alan account and I can reload fine I just cant save the edited files unless I take owner ship. This is the command I would run form the Nagios folder to do that - chown -R myUserName ./*. So I am not sure if this is just something I cannot do. I have not added teh nagios account to the sudoers file which may fix it but I am not sure if that is a good idea.
I have a Cent-OS 8 Ansible server that I do the same thing with and can make changes and save files with no issues. This is how I started trying to get this to also work on this server.
If I take ownership of the all the files it works fine but when I tried to add a new switch to the Nagios UI or make a change it did not take the changed. Do I switched back ownership to the nagios user. Now I SSHed to the server as the nagios user through VS Code and again I can now edit the file in VS Code but when I run /etc/rc.d/init.d/nagios reload it gives me errors. So I do su alan then try to reload it I get errors. So I close the ssh session and open another one with the alan account and I can reload fine I just cant save the edited files unless I take owner ship. This is the command I would run form the Nagios folder to do that - chown -R myUserName ./*. So I am not sure if this is just something I cannot do. I have not added teh nagios account to the sudoers file which may fix it but I am not sure if that is a good idea.
I have a Cent-OS 8 Ansible server that I do the same thing with and can make changes and save files with no issues. This is how I started trying to get this to also work on this server.
Last edited by Alan on Thu Mar 05, 2020 5:00 pm, edited 1 time in total.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios user on centos
You did it as alanscottwilkerson wrote: as rootCode: Select all
su nagios
If you are your user (and that user has permissions) it would be
Code: Select all
sudo su nagiosRe: Nagios user on centos
That did take it:
Code: Select all
[alan@Svr-Monitor objects]$ sudo su
[root@Svr-Monitor objects]# su nagios
[nagios@Svr-Monitor objects]$ -
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios user on centos
There you go!Alan wrote:That did take it:
Code: Select all
[alan@Svr-Monitor objects]$ sudo su [root@Svr-Monitor objects]# su nagios [nagios@Svr-Monitor objects]$
Re: Nagios user on centos
Thanks for the help. One last question. Would it hurt anything I other users are part of the Nagios group. I added my self to it and seemed like all the stuff I needed to do was working. But then all of a sudden I was not able to run /etc/rc.d/init.d/nagios reload anymore. Could being part of the nagios group cause that.
I also some how got knocked out of the wheel group and didnt notice it. So I dont know what one of those two things caused me not to restart the service.
I also some how got knocked out of the wheel group and didnt notice it. So I dont know what one of those two things caused me not to restart the service.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Nagios user on centos
I suspect not being in the wheel group is your issue.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Nagios user on centos
Thanks for the reply. It was caused by being out of wheel. I forgot to ad the -a for append when adding my self to the group so it added me to teh nagios group but took me out of all the other ones. Thanks for all the help on this. I think I am good now.