0

There are many questions around regarding ssh-agent, but none of the situations described seems to correspond to my problem.

First, I am using Lubuntu 14.04.4.

I have followed the instructions (found in arch wiki):

$ ssh-agent
$ eval $(ssh-agent)
$ ssh-add ~/.ssh/id_dsa

But when I do:

$ ssh -p 22 [email protected]

it asks for the password.

(There is an actual ip address, I just do not feel like sharing it ;-) )

I found somewhere to verify the following:

$ echo $SSH_AUTH_SOCK
/tmp/ssh-tw1EdcXYFnDd/agent.6550

which I understand as a valid output.

So what am I missing?

I also tried using ssh-pass but nothing happens.

Otherwise, I have no problem login in manually, it is just a pain in the ass to type constantly the password...

Thanks in advance.

Muru ask about the output of

    OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 19: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to xxx.xxx [xx.xxx] port xxx.
    debug1: Connection established.
    debug1: identity file /home/jofre/.ssh/id_rsa type 1
    debug1: identity file /home/jofre/.ssh/id_rsa-cert type -1
    debug1: identity file /home/jofre/.ssh/id_dsa type -1
    debug1: identity file /home/jofre/.ssh/id_dsa-cert type -1
    debug1: identity file /home/jofre/.ssh/id_ecdsa type -1
    debug1: identity file /home/jofre/.ssh/id_ecdsa-cert type -1
    debug1: identity file /home/jofre/.ssh/id_ed25519 type -1
    debug1: identity file /home/jofre/.ssh/id_ed25519-cert type -1
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.7
    debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.7
    debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.7 pat OpenSSH_6.6.1* compat 0x04000000
    debug2: fd 3 setting O_NONBLOCK
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug2: kex_parse_kexinit: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
    debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
    debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,[email protected],zlib
    debug2: kex_parse_kexinit: none,[email protected],zlib
    debug2: kex_parse_kexinit: 
    debug2: kex_parse_kexinit: 
    debug2: kex_parse_kexinit: first_kex_follows 0 
    debug2: kex_parse_kexinit: reserved 0 
    debug2: kex_parse_kexinit: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519
    debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
    debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
    debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,[email protected]
    debug2: kex_parse_kexinit: none,[email protected]
    debug2: kex_parse_kexinit: 
    debug2: kex_parse_kexinit: 
    debug2: kex_parse_kexinit: first_kex_follows 0 
    debug2: kex_parse_kexinit: reserved 0 
    debug2: mac_setup: setup [email protected]
    debug1: kex: server->client aes128-ctr [email protected] none
    debug2: mac_setup: setup [email protected]
    debug1: kex: client->server aes128-ctr [email protected] none
    debug1: sending SSH2_MSG_KEX_ECDH_INIT
    debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
    debug1: Server host key: ccccccccccccccccccccccccc (modified by Jofre)
    debug1: Host '[xxxxxxxxx]:yyy' is known and matches the ECDSA host key.
    debug1: Found key in /home/jofre/.ssh/known_hosts:6
    debug1: ssh_ecdsa_verify: signature correct
    debug2: kex_derive_keys
    debug2: set_newkeys: mode 1
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug2: set_newkeys: mode 0
    debug1: SSH2_MSG_NEWKEYS received
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug2: service_accept: ssh-userauth
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug2: key: /home/jofre/.ssh/id_rsa (xxxxxxxxxxxxxxxx),
    debug2: key: /home/jofre/.ssh/id_dsa ((nil)),
    debug2: key: /home/jofre/.ssh/id_ecdsa ((nil)),
    debug2: key: /home/jofre/.ssh/id_ed25519 ((nil)),
    debug1: Authentications that can continue: publickey,password
    debug1: Next authentication method: publickey
    debug1: Offering RSA public key: /home/jofre/.ssh/id_rsa
    debug2: we sent a publickey packet, wait for reply
    debug1: Authentications that can continue: publickey,password
    debug1: Trying private key: /home/jofre/.ssh/id_dsa
    debug1: key_parse_private2: missing begin marker
    debug1: key_parse_private_pem: PEM_read_PrivateKey failed
    debug1: read PEM private key done: type <unknown>
    Enter passphrase for key '/home/jofre/.ssh/id_dsa': 

I have replaced what I considered sensitive information by xxxxxxx or cccccccc.

Anyway thanks for asking for more info.

Update 27/05/2016: Following the observation of Waltinator that I was getting a message regarding the format of the file, I checked it, and not found any obvious mistaken. Normal, as that file has never edited by hand.

I simply give up, and generate a new password-less key and use ssh-copy-id as suggested by Julen. It works. I have marked the title as solved.

2

1 Answer 1

0

See which keys are in your keyring with ssh-add -l.

The last several log lines:

debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/jofre/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/jofre/.ssh/id_dsa
debug1: key_parse_private2: missing begin marker
debug1: key_parse_private_pem: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/home/jofre/.ssh/id_dsa': 

Show that your ssh command sends your public key from /home/jofre.ssh.id_rsa, and waits for a reply. The sshd server on the other end does not accept your private key (as @julen-larrucea: said, use ssh-copy-id to get a useable key to the other end).

Then, your ssh tries to use a different key file, /home/jofre/.ssh/id_dsa, but the file doesn't have the right format (missing begin marker) so it gives up and prompts you for a passphrase for /home/jofre/.ssh/id_dsa, the malformed file. Read man ssh-keygen, and probably mv /home/jofre/.ssh/id_dsa\{,.hidden\} to rename it to /home/jofre/.ssh/id_dsa.hidden which will make ssh ignore it, and keep it where you can get it back if.

0

You must log in to answer this question.

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