-2

I am two servers A and B under the same firewall. I can login from server A to B using root account but I cannot login from B to A. My ssh keys are properly configured but I am not able to figure our what is wrong.

This is the verbose of when I try connect from server B to A.

root@web04:~# ssh -v -i.ssh/id_rsa [email protected]
OpenSSH_5.9p1 Debian-5ubuntu1.4, OpenSSL 1.0.1 14 Mar 2012
Warning: Identity file .ssh/id_rsa not accessible: No such file or directory.
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 11.11.11.4 [11.11.11.4] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: read_keyfile_line: /root/.ssh/id_dsa.pub line 1 exceeds size limit
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.4
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.4 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.4
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 2c:37:bc:c8:47:07:53:07:9c:a8:f8:1d:12:a6:4a:a0
debug1: Host '11.11.11.4' is known and matches the ECDSA host key.
debug1: Found key in /root/.ssh/known_hosts:11
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
Ubuntu 12.04 LTS
-------------------------------------
UNAUTHORISED ACCESS IS PROHIBITED!!
-------------------------------------
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: read PEM private key done: type DSA
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Next authentication method: passwor
4
  • Did you check /etc/ssh/sshd_conf? There should be a PermitRootLogin parameter that is probably set to no Jul 2, 2014 at 13:54
  • What do the server logs say?
    – Jenny D
    Jul 2, 2014 at 13:54
  • 2
    Forbidding direct access to the root user via SSH is a best practice advised by most "securing your server" guides. You should SSH in as a normal user and use su/sudo when you need privileged access.
    – ceejayoz
    Jul 2, 2014 at 13:54
  • Looks like your public key is corrupted: read_keyfile_line: /root/.ssh/id_dsa.pub line 1 exceeds size limit
    – Nathan C
    Jul 2, 2014 at 14:14

1 Answer 1

5

Please check the Option "PermitRootLogin" in /etc/ssh/sshd_config is set to "yes".

Please note that this is usually set to "no" or "public-key" since logging in as root via SSH is widely considered an security problem.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .