'Raspberry Pi SSH permission denied
I went through existing threads and was unable to find a solution for my issue.
I am using Raspberry Pi 2 model B and am able to use it by connecting to Display via HDMI. I am now trying to SSH via my macbook air (OS Sierra) and am using Gigaware USB to ethernet adapter. My steps are as follows:
- in terminal type: ssh -v pi@
- when prompted to enter password, enter "raspberry" (my terminal asks me three times to enter a password and then the fourth time to enter password for pi@).
Thank you for your help
I'm getting the following output:
Last login: Sun Jun 25 16:33:22 on ttys000 Annas-MacBook-Air:~ annazotova$ ssh -v [email protected] OpenSSH_7.3p1, LibreSSL 2.4.1 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 20: Applying options for * debug1: /etc/ssh/ssh_config line 102: Applying options for * debug1: Connecting to 192.168.0.3 [192.168.0.3] port 22. debug1: Connection established. debug1: key_load_public: No such file or directory debug1: identity file /Users/annazotova/.ssh/id_rsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/annazotova/.ssh/id_rsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/annazotova/.ssh/id_dsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/annazotova/.ssh/id_dsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/annazotova/.ssh/id_ecdsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/annazotova/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/annazotova/.ssh/id_ed25519 type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/annazotova/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_7.3 debug1: Remote protocol version 2.0, remote software version OpenSSH_7.3 debug1: match: OpenSSH_7.3 pat OpenSSH* compat 0x04000000 debug1: Authenticating to 192.168.0.3:22 as 'pi' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: [email protected] debug1: kex: host key algorithm: ecdsa-sha2-nistp256 debug1: kex: server->client cipher: [email protected] MAC: compression: none debug1: kex: client->server cipher: [email protected] MAC: compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ecdsa-sha2-nistp256 SHA256:LPy5oyssyqW7GgMg0P3ygylRK1bSAxTbijXYWIcpnNc debug1: Host '192.168.0.3' is known and matches the ECDSA host key. debug1: Found key in /Users/annazotova/.ssh/known_hosts:10 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= debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password,keyboard-interactive debug1: Next authentication method: publickey debug1: Trying private key: /Users/annazotova/.ssh/id_rsa debug1: Trying private key: /Users/annazotova/.ssh/id_dsa debug1: Trying private key: /Users/annazotova/.ssh/id_ecdsa debug1: Trying private key: /Users/annazotova/.ssh/id_ed25519 debug1: Next authentication method: keyboard-interactive Password: debug1: Authentications that can continue: publickey,password,keyboard-interactive Password: debug1: Authentications that can continue: publickey,password,keyboard-interactive Password: debug1: Authentications that can continue: publickey,password,keyboard-interactive debug1: Next authentication method: password [email protected]'s password: debug1: Authentications that can continue: publickey,password,keyboard-interactive Permission denied, please try again. [email protected]'s password:
Solution 1:[1]
You aren't providing an address to ssh into. The command should be
ssh pi@[ip address of your pi]
If you don't know the ip address and you're on the same network, you can use its host name. By default it is raspberrypi.
ssh [email protected]
Solution 2:[2]
here's what resolved the problem for me;- ( Background information .. I'm using a windows 10 laptop with an RPI version 3 board, communicating across my wifi network via my Netgear router. Using the laptop and it's monitor - no key-board or monitor connected to the RPI 3 board. Tightvncserver was previous installed and working on the rPI board )
here is how I resolved the defect;-
Powered down the RPI board Powered down the laptop Powered down the router
Waited about 2 minutes Powered up the router, power up the laptop and logged onto the network Powered up the RPI 3 board.
used Putty on the laptop to connect to the RPI board - That now worked ! used winscp to connect across to the RPI board - that now worked, including using the existing RPI user name and existing password.
Was able to start up the tightvncserver using the command tightvncserver (as normal ) since putty and winscp were now working, and the problem was now limited to being unable to connect via VNC. The tightvncserver on the RPI board was rejecting the correct password. I suspected that the problem was something to do with the tightvnc server settings. So ... I Used the vncpasswd to change the VNC server password, as explained at https://www.itfixed.com/2009/05/how-to-change-vnc-server-password-on-linux/ That worked ! Interfacing between my laptop and the RPI 3 board was restored as normal. While I do not know exactly what caused the defect to occur,
I Hope this information may help others
Solution 3:[3]
New installation will not be able to use default pi, raspberry as credentials. For security reasons RPi will ask to make a new user on the first boot itself.
If you want to do this headlessly. Use RPi Imager and on selecting OS to write you will see a settings icon. In Setting you can create a user add a wifi credentials and also enable ssh
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | whetfire |
Solution 2 | Robert |
Solution 3 | Decoy |