1

Possible Duplicate:
Why is “chmod -R 777 /” destructive?

I have CentOS 6.3 minimal installed. No desktop or GUI. All the while, I was able to login as root. Today, I come to work and find the same password no longer works. I was the only one who knew the password and no one in the office touches this machine. I have verified it using CCTV.

When I enter the password it gives me the following error:

centos2 login: root
Password:
Login incorrect

I have tried SSH via Putty as well as WinSCP. I get Network Error: Connection refused.

So what could have gone wrong?

Please advise.

Please Note: root is the only user on this machine. I have not made any other user yet. Or maybe I did but I cannot remember since I have been using root for several days now.

UPDATE: I tried to reset the password following the instructions on some other site. All went well, except I get the same error despite changing the password!

UPDATE: This server is my test server and I try a lot of things on it. The last major thing I did was to select all the directories in WinSCP and give them 777 permissions. Could this have anything to do with the problem?

4 Answers4

4

Congratulations, you broke it beyond repair. Your only option at this point is to recover what data you can (try booting from a Live CD) and rebuild the server from scratch.

Michael Hampton
  • 252,907
1

Is it safe to reboot the server, or you run some production on it already? I would first check that you have correct keyboard map chosen, and if so, I would probably just change root password using single user boot, or recovery mode, chroot and passwd.

Mark
  • 63
0

I would boot in to recovery mode and check to see if allow login as root is enabled in the ssh config.

File: /etc/ssh/sshd_config
Option: PermitRootLogin yes

While you are in recoery mode it might be with adding a non root account with sudo access so you can try that should you still have issues logging in as root.

If you don't have a recovery option then at boot time you can edit the kernel line at the boot loader screen.

Add

init=/bin/bash

This will drop you in to a usable shell without having to login.

Epaphus
  • 1,021
0

This looks like the root user is being inhibited from logging in over the network. This is likely as part of the default install configurations that I have seen over the years.

Question: Can you login to root from directly from the system console on the machine itself and NOT use any networked login?

If so, then you have the prime responsibility that the tty being logged into the system from is not listed in /etc/securetty file. The system will not give any clue that this is happening for security reasons.

One other idea .. another idea is possible corruption of the /etc/passwd, or /etc/shadow files.

mdpc
  • 11,914