4

I ran some usermod command, through SSH, now I can't get back into my Pi by using the line that worked before (ssh pi@192.168.x.x) because it says 'Permission denied, please try again'. I tried formatting and re-installing the O/S onto the SD Card, but the same exact error is being given, as if I did not format it?

I had installed Apache when it was working fine, (before the format) and it seems that now, after the format, Apache is being started when the device is switched on (I hooked it up to a TV and it says Apache server running or something like that)

Can anyone identify the problem?

--

So this is what i got entering ssh -v pi@192.168.x.x:

OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.104 [192.168.0.104] port 22.
debug1: Connection established.
debug1: identity file /Users/xxxxxx/.ssh/id_rsa type -1
debug1: identity file /Users/xxxxxx/.ssh/id_rsa-cert type -1
debug1: identity file /Users/xxxxxx/.ssh/id_dsa type -1
debug1: identity file /Users/xxxxxx/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-3
debug1: match: OpenSSH_6.0p1 Debian-3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
The authenticity of host '192.168.104 (192.168.0.104)' can't be established.
RSA key fingerprint is a1:2b:d7:53:34:dc:89:ef:08:4a:26:c0:03:5b:20:4e.
Are you sure you want to continue connecting (yes/no)? 
So I hit Yes, and enter the password, then this comes up:

debug1: Authentications that can continue: publickey,password Permission denied, please try again.

:(

--

I messed up some root permissions, I'm certain the password is correct but I think it's telling me Access Denied/Permission Failed because of the permissions, but now since I can't login I don't know how I can change them?

As I said earlier, I tried formatting my SD card and re-booting the device, although it seems like I did not even format it as the same permission problems like before are still there. Could it be that I'm not formatting correctly?

-- Updated:
@Jivings I had the same thoughts, so I tried to access it via my PC using Putty, and it would give me ACCESS DENIED.

  • It's not clear to me so please explain - the same problem occurs even after completely rewriting your SD card with fresh, clean installation of the system? Also, if you could add -v option to your ssh command (ssh -v pi@192.168.x.x) and edit your question to contain full output of this command, it would help to identify the problem. – Krzysztof Adamski Apr 25 '13 at 9:58
  • 1
    Thanks for the comment krzysztof. Yes, a complete fresh installation. Altough before the format, when it was working, I installed Apache. And now when I boot up my Pi it seems to start running Apache - if I had a fresh install of the system, how is Apache still there? I will try what you told me when I get back home – Nik Apr 25 '13 at 13:22
  • 1
    Unfortunately it seems like you're giving it the wrong password. Or something else is wrong. The only way to find out is to look at the log files on the Pi. But in order to do this, you would first have to log in. – Krzysztof Adamski Apr 26 '13 at 6:23
  • I think the permissions you messed up are on your host system. Can you try accessing the Pi from anywhere else? – Jivings Apr 26 '13 at 7:38
  • Are you certain the password is correct? – Jivings Apr 26 '13 at 20:57
7

I had the same issue and in my case it was due to the different keyboard layouts.

Pi uses UK keyboard layout by default. I had entered " character instead of @ when creating the password. Changed the rpi's keyboard layout and the password.

  • 2
    thanks! I did not know the PI had the UK layout. Indeed that was the problem for me. – phil_w Jun 13 '14 at 0:42
  • 2
    Couldn't leave a comment, but the UK -> US keyboard fix works! – TheSashmo Jun 29 '14 at 17:30
0
  1. you should check permissions of your ~/.ssh directory (should be 0700)
  2. you may try to use ssh host -l user instead of ssh user@host, especially if you login name on the current system is not the same as login on the remote system.
  3. if you have changed your login password before, please, remember it might be reset back to 'raspberry' after you reformat your SD card.
  • 4
    user@host is equivalent to host -l user. – Lekensteyn May 11 '13 at 11:09
0

use [ ssh user_name_or_computer_name@host_ip_address ]

use correct user_name of your system with correct host_ip_address my laptop username is suman and host_ip_address is 192.168.1.4 and I was able to connect enter image description here

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.