0

I've got a machine running Ubuntu in the office.I've got a machine running Mint at home. My goal is to be able to work from home connecting to the office with ssh.

I swear i tried to look for similar errors in the forum but they all were to me different or the solution was weird to me. Please be patient with me.

what i did:

i took my personal home laptop at work to configure it correctly.

purged from both machines ssh

installed them again

tried to ssh from client (personal laptop) to server (work machine) it doesn't work. It seems not able to recognize my password.

stefania@host's password: 
Permission denied, please try again.
stefania@host's password: 
Permission denied, please try again.
stefania@host's password: 
Permission denied (publickey,password)

tried then to avoid the issue using rsa keys for authentication

ssh-keygen -t rsa on the client

left with no passphrase

ssh-copy-id wouldn't work (with the same password issue -of course-) so i manually generated the authorized_keys file on the server side transferring the client id_rsa.pub with a pendrive and made sure it was chmod 600 and chmod 700 on both ~/.ssh folders.

all the config files (/etc/ssh/ssh_config and /etc/ssh/sshd_config) are untouched and therefore set as default and rsakey authentication is enabled. (Just to make crystal clear i didn't have errors in them i compared both files with the ones by a friend which is actually able to ssh connect and they are the same)

retried

ssh -vvv name@host 

(i'll post only the interesting bits)

OpenSSH_6.2p2 Ubuntu-6ubuntu0.4, OpenSSL 1.0.1e 11 Feb 2013
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 hostip [hostip] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/clientuser/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /home/clientuser/.ssh/id_rsa type 1

debug1: Server host key: RSA 78:0e:41:cd:69:50:e5:25:b3:98:0d:c1:cb:37:69:c6
debug3: load_hostkeys: loading entries for host "hostip" from file "/home/clientuser/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /home/clientuser/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys
debug1: Host 'hostip' is known and matches the RSA host key.
debug1: Found key in /home/clientuser/.ssh/known_hosts:1
debug2: bits set: 557/1024
debug1: ssh_rsa_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: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/clientuser/.ssh/id_rsa (0x7f8c00e1c690),
debug2: key: /home/clientuser/.ssh/id_dsa ((nil)),
debug2: key: /home/clientuser/.ssh/id_ecdsa ((nil)),
debug3: input_userauth_banner
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/clientuser/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/clientuser/.ssh/id_dsa
debug3: no such identity: /home/clientuser/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/clientuser/.ssh/id_ecdsa
debug3: no such identity: /home/clientuser/.ssh/id_ecdsa: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
serveruser@hostip's password: 

the server side fails to find the key and propmpts for a password which doesn't work as mentioned.

i'm lost. many thanks

  • To make things a bit clear, you entered your password of your account on the server not the client, right? Regarding RSA key the punch line is "Could not load "/home/clientuser/.ssh/id_rsa" as a RSA1 public key"..Did you save your public key on the server as /home/user/.ssh/known_hosts? – heemayl Dec 4 '14 at 5:56
  • I certainly entered the password of my account on the server while trying to connect to the server. I've saved my client public key into home/user/.ssh/authorized_keys on the server side – atreyu Dec 5 '14 at 3:42
  • Great. Here are the debugged output while ssh-ing into one of my test environments: debug1: Offering RSA public key: /home/chayan/.ssh/id_rsa debug1: Server accepts key: pkalg ssh-rsa blen 279 As you can see the server is accepting my key and establishing the connection, which is not happening in your case where the client is sending the key but is not getting any response in return from the server as shown below: debug1: Offering RSA public key: /home/clientuser/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply – heemayl Dec 5 '14 at 4:10
  • It would be really helpful to diagnose further if you can try to ssh again and check the auth.log/syslog regarding that and append it in your original question. Also check for any firewall issue. – heemayl Dec 5 '14 at 4:11
  • You are right. I'm not expert but it could really be a firewall related issue since the server machine is at work i expect that network to be in some way protected. – atreyu Dec 5 '14 at 4:14
0

I am not expert here,

But in my suggestion, please try to use this tutorial:

https://help.ubuntu.com/community/SSH/OpenSSH/Keys

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.