LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-19-2015, 05:00 PM   #1
Planky
Member
 
Registered: Aug 2003
Posts: 35

Rep: Reputation: 0
Root password changing repeatedly


I have an odd problem with a VPS I have at digitalocean. The root password keeps changing and forcing me to reset via digitaloceans control panel.

Im not sure exactly what time/date it changes, only when I get a message from WHM saying it cannot access the DNSOnly server anymore as the password was invalid.

The VPS is running Centos 5.10 and has WHM DNSOnly installed. I emailed Digital Oceans support and got this response:

Quote:

Thank you for contacting us regarding this issue. It's unclear what would cause the root password to change, however you may consider reviewing the system logs and the ssh related logs to identify what actions may be listed related to this.

You can check the `history` command, or check `last` to see if you see any odd details. If you have any further questions, concerns or additional information, please don't hesitate to provide them.
I do not see anything in the SSH logs or anything in messages to indicate what is changing it. The last command only shows my connections via tty or SSH (invariably due to me having to force a reset and logon to change the password)

I thought I could use auditd to monitor passwd, but changing a password doesn't modify this file.

Does anyone have any suggestions on what to look for?
 
Old 01-19-2015, 05:26 PM   #2
Planky
Member
 
Registered: Aug 2003
Posts: 35

Original Poster
Rep: Reputation: 0
I ran this search against /var/log/secure, but can only see my manual password changes. Between those dates, something is stopping root from being able to login via console/ssh - I think this shows that the password itself is not changing and something else is stopping roots access.

Code:
root@ns3 [/var/log]# find . -name "secure*" -exec grep -Hn "password changed" {} \;
./secure-20150111:83231:Jan  5 18:05:08 ns3 login: pam_unix(login:chauthtok): password changed for root
./secure-20150111:101341:Jan  6 18:52:16 ns3 login: pam_unix(login:chauthtok): password changed for root
./secure-20150111:182928:Jan  9 01:03:10 ns3 login: pam_unix(login:chauthtok): password changed for root
./secure:77430:Jan 19 17:49:41 ns3 login: pam_unix(login:chauthtok): password changed for root
 
Old 01-19-2015, 07:06 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,965

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
Root passwords don't just change. There is no sort of maybe kind of if on this.

It is bad.

Time to reload current OS from scratch, get all software updates. Use as many best practices as you can to avoid this in the future.

All your data is suspect now. Backup could be an issue.
 
Old 01-19-2015, 07:45 PM   #4
Planky
Member
 
Registered: Aug 2003
Posts: 35

Original Poster
Rep: Reputation: 0
Its a brand new vps, fresh install of Centos and then DNSOnly installed on top. No other config or data on it. As per my 2nd post, given secure log doesn't mention a password change outside of me resetting it, so it must be something other than a password change...

Next time it happens I'll give it a reboot to see if its a crashed service or some such.

Last edited by Planky; 01-19-2015 at 07:56 PM.
 
Old 01-20-2015, 08:07 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
What is "ns3"?
 
Old 01-20-2015, 08:34 AM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,632
Blog Entries: 4

Rep: Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931
If the root-password on a box is changing without you knowing it, why do you trust any of "the logs?"

Compromised computers are like enemy soldiers. You don't try to compromise with them. You don't look at pictures of their grandkids. You shoot 'em.
 
Old 01-20-2015, 08:50 AM   #7
Ihatewindows522
Member
 
Registered: Oct 2014
Location: Fort Wayne
Distribution: Ubuntu 16.04 LTS
Posts: 616
Blog Entries: 2

Rep: Reputation: 166Reputation: 166
Part of the problem might lie in the fact that he's using CentOS 5. Although still technically supported, I wouldn't use it at all. As with Debian 6, they may be exploiting shellshock, and then just covering their tracks. Bottom line: reinstall with a newer distro.
 
Old 01-20-2015, 06:34 PM   #8
Planky
Member
 
Registered: Aug 2003
Posts: 35

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Habitual View Post
What is "ns3"?
Name of the server

Quote:
Originally Posted by sundialsvcs View Post
If the root-password on a box is changing without you knowing it, why do you trust any of "the logs?"

Compromised computers are like enemy soldiers. You don't try to compromise with them. You don't look at pictures of their grandkids. You shoot 'em.
I made the assumption that the password is changing - however I am not sure of that. All I know is that one day I can login, the next day I cannot. Performing a password reset via the digitalocean control corrects it (it powers off the server and modifies it with some external process/script). I was going to wait till it happened again to see if just a reboot fixed it.

Quote:
Originally Posted by Ihatewindows522 View Post
Part of the problem might lie in the fact that he's using CentOS 5. Although still technically supported, I wouldn't use it at all. As with Debian 6, they may be exploiting shellshock, and then just covering their tracks. Bottom line: reinstall with a newer distro.

I would use a later OS, except of daft limitations WHMs DNSOnly app. There are apparently workarounds to get it to install on later versions, but then WHM/Cpanel won't support it.

I've deleted the VPS and will start from scratch again.

Last edited by Planky; 01-20-2015 at 06:38 PM.
 
Old 01-23-2015, 10:28 AM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by jefro View Post
Time to reload current OS from scratch
Please do not advise fellow LQ members to do that without proper investigation.


Quote:
Originally Posted by Ihatewindows522 View Post
Part of the problem might lie in the fact that he's using CentOS 5. Although still technically supported, I wouldn't use it at all. As with Debian 6, they may be exploiting shellshock, and then just covering their tracks. Bottom line: reinstall with a newer distro.
Pure, uncut male cow manure. CentOS 5 is not "technically" supported: it is officially supported, meaning it gets the security fixes it needs: http://wiki.centos.org/Security/Shellshock. If you don't know your stuff then feel free to keep yourself from posting.


Quote:
Originally Posted by Planky View Post
I've deleted the VPS and will start from scratch again.
That is a shame as it would have been my pleasure to help you investigate. *Please note that while you are free to follow any advice given, and you are the only one responsible for gauging the quality of said advice, on LQ there really are about five people I trust to perform incident handling the way I want to see it done.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Root password changing sagar666 Linux - Server 1 07-03-2014 12:36 AM
Unable to login using root after changing root password using passwd command rodimail SUSE / openSUSE 3 12-27-2011 10:34 PM
Changing root password Micik Linux - Newbie 4 10-15-2011 09:05 AM
changing root password Bombo Linux - Newbie 2 04-10-2005 10:42 PM
changing root password minm Linux - Newbie 9 08-31-2004 03:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration