guarriman
Posts: 7
Joined: Sat Nov 16, 2013 1:58 pm

ssh: Permission denied, please try again.

Sat May 28, 2016 12:26 pm

Hi.

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:

Code: Select all

# ssh pi@192.168.1.100 
But I get this error message:

Code: Select all

pi@192.168.1.100's password: 
Permission denied, please try again.
What am I doing wrong? Thank you very much.

User avatar
B.Goode
Posts: 8025
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: ssh: Permission denied, please try again.

Sat May 28, 2016 2:17 pm

I can think of 3 possibilities - there may be others:

1. You have mis-remembered your new password;

2. Your ssh client is getting the mapping of some obscure symbol wrong;

3. 192.168.1.100 is not the IP address of your RPi.

guarriman
Posts: 7
Joined: Sat Nov 16, 2013 1:58 pm

Re: ssh: Permission denied, please try again.

Sat May 28, 2016 2:53 pm

Thank you very much for your answer, B.Goode.

I have just ssh-ed within the raspberry (not from the external PC)
# ssh pi@192.168.1.100
and it worked ok. So:

1. You have mis-remembered your new password;
Discarded.

2. Your ssh client is getting the mapping of some obscure symbol wrong;
It is a very simple password (only letters, even no digits), and my client is the Ubuntu terminal. I have no problems ssh-ing other servers.

3. 192.168.1.100 is not the IP address of your RPi.
Discarded.

User avatar
rpdom
Posts: 14699
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: ssh: Permission denied, please try again.

Sat May 28, 2016 5:04 pm

Ok, try

Code: Select all

ssh -v pi@192.168.1.100
and post the output here.

guarriman
Posts: 7
Joined: Sat Nov 16, 2013 1:58 pm

Re: ssh: Permission denied, please try again.

Sat May 28, 2016 7:23 pm

This is the output

Code: Select all

jimmy@myPC:~/.ssh$ ssh -vv pi@192.168.1.100
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/jimmy/.ssh/id_rsa type -1
debug1: Found key in /home/jimmy/.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/jimmy/.ssh/id_rsa ((nil))
debug2: key: /home/jimmy/.ssh/id_dsa ((nil))
debug2: key: /home/jimmy/.ssh/id_ecdsa ((nil))
debug2: key: /home/jimmy/.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/jimmy/.ssh/id_rsa
debug1: Trying private key: /home/jimmy/.ssh/id_dsa
debug1: Trying private key: /home/jimmy/.ssh/id_ecdsa
debug1: Trying private key: /home/jimmy/.ssh/id_ed25519
debug2: we did not send a packet, disable method
debug1: Next authentication method: password
pi@192.168.1.100's password: 
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.

User avatar
rpdom
Posts: 14699
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: ssh: Permission denied, please try again.

Sat May 28, 2016 7:53 pm

Curious... there's quite a few lines that I would expect to be in there that aren't. Especially ones something like

Code: Select all

debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.7p1 Raspbian-5+deb8u2
debug1: match: OpenSSH_6.7p1 Raspbian-5+deb8u2 pat OpenSSH* compat 0x04000000
That's running from my Ubuntu system to a Pi2 running Raspbian Jessie.

guarriman
Posts: 7
Joined: Sat Nov 16, 2013 1:58 pm

Re: ssh: Permission denied, please try again.

Sat May 28, 2016 8:05 pm

Sorry, I must have removed some lines.

This is a copypaste:

Code: Select all

jimmy@myPC:~/.ssh$ ssh -v pi@192.168.1.100
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 *
debug1: Connecting to 192.168.1.100 [192.168.1.100] port 22.
debug1: Connection established.
debug1: identity file /home/jimmy/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/jimmy/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/jimmy/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/jimmy/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/jimmy/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/jimmy/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/jimmy/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/jimmy/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu1
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 192.168.1.100:22 as 'pi'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:jN2kWx4QPAe6jR5iJXgDmtYogwwZkfaL+ryqUHOPStM
debug1: Host '192.168.1.100' is known and matches the ECDSA host key.
debug1: Found key in /home/jimmy/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/jimmy/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/jimmy/.ssh/id_dsa
debug1: Trying private key: /home/jimmy/.ssh/id_ecdsa
debug1: Trying private key: /home/jimmy/.ssh/id_ed25519
debug1: Next authentication method: password
pi@192.168.1.100's password: 
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
pi@192.168.1.100's password: 

User avatar
DougieLawson
Posts: 35521
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: ssh: Permission denied, please try again.

Sat May 28, 2016 8:30 pm

Who owns /home/pi/.ssh and the files in there? What are the permission bits for those?

Code: Select all

pi@pi-client:~/.ssh $ ls -la
total 24
drwx------  2 pi pi 4096 May 23 23:17 .
drwxr-xr-x 24 pi pi 4096 May 27 20:04 ..
-rw-------  1 pi pi  392 May  8 18:55 authorized_keys
-rw-------  1 pi pi 1675 May 23 23:17 id_rsa
-rw-r--r--  1 pi pi 1998 May 23 23:04 known_hosts
-rw-r--r--  1 pi pi  394 May 23 23:17 id_rsa.pub
pi@pi-client:~/.ssh $
Note: Having anything remotely humorous in your signature is completely banned on this forum. Wear a tinfoil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
rpdom
Posts: 14699
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: ssh: Permission denied, please try again.

Sat May 28, 2016 8:43 pm

guarriman wrote:3. 192.168.1.100 is not the IP address of your RPi.
Discarded.
Incorrect answer.
guarriman wrote:Sorry, I must have removed some lines.

This is a copypaste:

Code: Select all

debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu1
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu1 pat OpenSSH* compat 0x04000000
That clearly shows that you are trying to connect to a system running Ubuntu, not Raspbian. Compare it to the lines I posted

Code: Select all

debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.7p1 Raspbian-5+deb8u2
debug1: match: OpenSSH_6.7p1 Raspbian-5+deb8u2 pat OpenSSH* compat 0x04000000
which show Raspbian as the remote system being connected to.

User avatar
B.Goode
Posts: 8025
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: ssh: Permission denied, please try again.

Sat May 28, 2016 8:49 pm

As @rpdom points out, I am sticking with my Option #3.

User avatar
DougieLawson
Posts: 35521
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: ssh: Permission denied, please try again.

Sun May 29, 2016 8:12 am

There's two easy ways to find an RPi's IP address

On the RPi
hostname -I # capital eye not ell

From any other machine
nmap -v -sn 192.168.1.0/24
or Fing from https://www.fingbox.com/
Note: Having anything remotely humorous in your signature is completely banned on this forum. Wear a tinfoil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

techri
Posts: 1
Joined: Sat Nov 25, 2017 6:08 am

Re: ssh: Permission denied, please try again.

Sat Nov 25, 2017 6:41 am

When i try to ssh into my pi i get a "Sorry try again" error
it doesn't say permission denied. I'm wondering if it's the same error your'e getting ?

jbirriel84
Posts: 1
Joined: Tue Jan 15, 2019 4:58 am

Re: ssh: Permission denied, please try again.

Tue Jan 15, 2019 5:13 am

When you login from Ubuntu you have to type ssh pi@(your pi's ip address) replace your pi's ip address with the ip address of your pi, then hit enter it should prompt you to enter the password this will be the password for the pi. If you just type ssh and then the pi ip address it does not work, it will say permission denied when you enter the password even if the password is correct. The raspberry pi I tried it on has the username pi, if for some reason ssh pi@(ip address) does not work and you have a different username try ssh username@(ip address). Hope it helps.

Return to “Troubleshooting”