0

For some reason, after a plesk update, I can no longer login to ssh as root using my old password. I have tried to create a user with:

/bin/bash & /bin/bash (chrooted) in plesk

Which lets me login but has no root privileges. How can I either recover my old password or get access to the ssh config to check whether root login is disabled. I installed ssh term in plesk, but that bums out with an error of:

jarsigning exception

Guess it's because there is only the default certificate on the server. I would be grateful if someone could help with this as I have reached a point where I am struggling to find other things to try. Many thanks

Plesk 11.5 CentOS 6 SSH Client

  • 1
    Once logged in, can you switch to root (su - root) using your old root password? – EightBitTony Jul 22 '14 at 11:12
3

Depending on your SSH configuration (usually defined in /etc/ssh/sshd_config) root access may be disabled in a number of ways:

  • No root access at all (PermitRootLogin=No or DenyUsers root)
  • root is allowed access, but only via key-pair authentication (PermitRootLogin=without-password or PasswordAuthentication=no)
  • root access is allowed, but only specific commands can be executed (PermitRootLogin=forced-commands-only)
  • root is allowed, but only via specific ACLs which can restrict from where, whom and to which users they can access ssh (such as Host, AllowUsers etc)
  • tcpwrappers have been used, and there are entries in /etc/hosts.allow and /etc/hosts.deny which restrict ssh access.
  • You are not using the correct protocol with your client (v1 vs. v2 set with Protocol 2), though this is unlikely.

There are a few routes to gaining root access. First of all try connecting to the ssh daemon from different host locations (using ssh to root@localhost on the machine itself, or connecting to its public IP address from an external host). Next you can try using su to gain root access with the command su - root (some operating systems enforce your user to be in the wheel group to do this) - this command expects you to provide the root users' password. You can also try sudo, if it is installed and configured to give your user root access (sudo bash), which expects the password of the account using the sudo command (or no password at all if sudo is configured that way).

If none of these work, the next thing would to go down the route of rebooting your operating system in single user mode and trying your root password there. If that still doesn't work then you probably need to reset the root password and will have to boot from a recovery or live CD and reset the password that way.

Once you have gained root access, the configuration can be tweaked by checking the settings mentioned above to assure future ssh access. Remember to SIGHUP (killall -SIGHUP sshd) or restart the ssh daemon if you make configuration changes.

|improve this answer|||||
  • Thank you for your very informative comments. Just to update, I did a recovery of the server and reset the root password to a new one. It still is refusing to accept the password in ssh for root. Afetr further research, it appears that it could be a corrupt etc/passwd file. Parallels state that running this command: cat /etc/passwd | grep ^root | hexdump -c the end of the file should end with, \n but mine ends with \r \n. This file I checked as a user with /bin/bash privs. Now the problem. I cannot check the passwd file at root. Any ideas? Thanks – user1532468 Jul 23 '14 at 8:42
  • I understand there are 2 etc/passwd locations. 1 for each user allocated on the system and the 2nd is in the etc root area. – user1532468 Jul 23 '14 at 8:43

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.