4

I have just installed raspbian on a Raspberry Pi 1 Model B, and I am trying to connect it via ssh.

I enabled 'ssh' via 'raspi-config', changed the password of 'pi' user from the default to another new one, and I tried from another PC:

# ssh [email protected] 

But I get this error message:

[email protected]'s password: 
Permission denied, please try again.

What am I doing wrong? Thank you very much.


If I do ssh -vv [email protected], I get this log:

thomas@externalPC:~/.ssh$ ssh -vv [email protected]
OpenSSH_7.2p2 Ubuntu-4ubuntu1, OpenSSL 1.0.2g-fips  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "192.168.1.100" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 192.168.1.100 [192.168.1.100] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/thomas/.ssh/id_rsa type -1
debug1: Found key in /home/thomas/.ssh/known_hosts:1
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug2: key: /home/thomas/.ssh/id_rsa ((nil))
debug2: key: /home/thomas/.ssh/id_dsa ((nil))
debug2: key: /home/thomas/.ssh/id_ecdsa ((nil))
debug2: key: /home/thomas/.ssh/id_ed25519 ((nil))
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/thomas/.ssh/id_rsa
debug1: Trying private key: /home/thomas/.ssh/id_dsa
debug1: Trying private key: /home/thomas/.ssh/id_ecdsa
debug1: Trying private key: /home/thomas/.ssh/id_ed25519
debug2: we did not send a packet, disable method
debug1: Next authentication method: password
[email protected]'s password: 
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
6
  • Did you try the old password (raspberry) to make sure it didn't not get changed? Also, if you use ssh -vv [email protected] you will get a lot more verbose information that might explain explicitly what the issue is, or at least provide a clue you could cut n' paste in above.
    – goldilocks
    Commented May 28, 2016 at 13:40
  • Just updated and pasted above. Thank you very much for your help :-)
    – Hookstark
    Commented May 28, 2016 at 15:03
  • You could try taking the card out and looking in /var/log/auth.log. This will show a record of successful and unsucessful login attempts by whatever means. If the unsuccessful logins are shown there, this proves sshd is denying you from the pi and therefore most likely: A) You've done something odd with sshd_config; B) The password is not what you think it is.
    – goldilocks
    Commented May 28, 2016 at 15:10
  • The file '/var/log/auth.log' shows a lot of issues. If I grep the string "ssh", the most relevant message is "Server listening on 0.0.0.0 port 22". No other messages about trying to connect.
    – Hookstark
    Commented May 28, 2016 at 15:29
  • 1
    Add some kind of mark to the file (the logger will not care if stuff has been added arbitrarily), put it back in the pi, try the remote login, take it out. This is to double-check if its actually adding anything when you try to log in. If it isn't, then there's definitely an issue with the sshd setup. If it is, it may help clarify exactly what's up.
    – goldilocks
    Commented May 28, 2016 at 15:33

1 Answer 1

1

From the original machine, change the password again (I'm assuming you can boot to desktop without asking for password). But use sudo (changes to root) - to force a change without knowing the current password. Use Command Terminal

pi@raspberrypi:~ $ sudo passwd pi
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

Then login from that machine back again (loopback) to test

$ ssh pi@localhost
Password: xxxxxx

If this works, proceed to the other machine - but make sure you've got the right IP address (there might be a duplicate IP around).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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