Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This question already has an answer here:

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

login: root 
Password: My-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 not the only user on this machine, I can access with another account and perform some command .

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

The last major thing I did was : create user , create group , associate the user to the group created and than change folder dir to the user inside etc/passwd. After that I start to have the root problem , so i cancel the user and the group created but i still facing the same problem

share|improve this question

marked as duplicate by MadHatter, mdpc, gWaldo, Ward, voretaq7 Aug 29 '13 at 15:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Since you can login as another user, you've looked at the logs haven't you? –  fukawi2 Aug 29 '13 at 6:54

1 Answer 1

Can you give us some logs about sshd to see what happens from inside /var/log directory.
just run # grep sshd * | grep the_number_of_the_date_that_you_want_to_check or you can run this grep -Ri ssh /var/log/*

Also:
1. Do you have a line in your sshd_config that refers to "AllowUsers"? (most dont but some do, and if yours does, you need your account listed on that line).
2. Do you have iptables allowing TCP 22?
3. The service i hope is started :) (# service sshd status)
4. Last but not least: is PermitRootLogin yes in /etc/ssh/sshd_config

share|improve this answer
    
UPDATE useful for beginner like me : This issue happen because customer edited the /etc/passwd from a Window environment. Noticed /etc/passwd file had DOS line endings. For example when we use vi editor to open /etc/passwd file following were noticed : vi /etc/passwd root:x:0:0:root:/root:/bin/bash^M The ^M should not be there and is likely introduced by editing on a Windows platform (although there could be other explanations). In order to fix the issue remove ^M at the end of each line in /etc/passwd file. Solution found on [access.redhat.com/site/solutions/258803] –  user2482756 Aug 29 '13 at 8:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.