9

I have a remote host, previously I can ssh into it with root and password

ssh root@remote_host

or I ssh into it first using a regular user account

ssh esolve@remote_host

and then su root and input password

but today, in both ways, my password is always incorrect, like

[esolve@local esolve]$  ssh root@remote_host
root@remote_host's password: 
Permission denied, please try again.

or

[esolve@remote_host ~]$ su root
Password: 
su: incorrect password

related information:

  1. I can use this password to log in with root if I operated locally on that remote machine today.

  2. I ssh into is via VPN

Why did this happen? How can I solve this problem?

  • 1
    If you are able to su root successfully but cannot log in as root via SSH, then the system administrator likely disabled root SSH access which is always a good idea. – j883376 Jun 14 '13 at 19:48
24

Do you have ssh as root disabled? Check your sshd configuration (possibly /etc/ssh/sshd_config) and look for the line PermitRootLogin no. Change the no to yes and restart sshd (most likely either service ssh restart or service sshd restart).

Some distributions (e.g., Ubuntu) default to without-password for PermitRootLogin such that root login is allowed via public key authentication, but not with a password.

  • what distribution? Also, are you logging in on a local terminal or trying to ssh as root to localhost? PermitRootLogin doesn't care if you start at localhost. – zje Jun 14 '13 at 20:22
1

For first time if you are access SSH remote server in new system, just update it. Open the ssh configuration file,

# vim /etc/ssh/sshd_config

PermitRootLogin without-password

change to

PermitRootLogin yes

Restart your ssh service.

restart ssh server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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