I'm trying to access my RPi 3 via Putty from a Windows 10 laptop. When it prompts me to choose the user I type in pi. I have tried typing in raspberry as the password, resetting the password with sudo passwd and trying with that password but nothing works. BTW I have already placed a file named ssh in the boot partition of my Pi so that it automatically boots with ssh on. I'm using NOOBS 2.1.0.

• Have you checked if your keyboard layout match when using Putty. Try writting the password instead of loggin, does it match? – jlandercy Jun 23 '17 at 16:39
• @jlandercy Yeah, It matches – Iliyan Jun 23 '17 at 17:23
• Using sudo passwd changes the root password. I don't remember if root logins via SSH are off by default, but I think they are. You should not permit root logins as a security measure. – Steve Robillard Jun 23 '17 at 17:24
• @SteveRobillard Ok, so since it changes the root password, I tried logging in with root@IP, but even then when writing the password it gives me the error. – Iliyan Jun 23 '17 at 17:29

Is this your first time trying to SSH into the Raspberry Pi? I did this a couple of days ago, and manually changed the Pi's configuration from the GUI interface to allow for SSHing, then rebooted.

In case you haven't seen it, here's the official documentation https://www.raspberrypi.org/documentation/remote-access/ssh/

• 1st: No, this isn't the last time I use SSH with my Pi, but the last time was quite long ago. 2nd: Yes, I did all of that, nothing seems to work. – Iliyan Jun 23 '17 at 16:27
• Have you tried resetting your ssh keys with ssh-keygen -R {RPi-IP-Address}? – ginginsha Jun 23 '17 at 16:37
• I tried the command, but it just gives me the following error: ssh-keygen: /home/.ssh/known_hosts: No such file or directory @ginginsha – Iliyan Jun 23 '17 at 17:25
• That is because root is not configured for SSH, Like I said you should not login as root. – Steve Robillard Jun 23 '17 at 17:30

To begin first of all you should NOT be using a the pi while connected to the internet with open ssh ports and default credentials allowed, this is madness. Your machine is likely already compromised in the worst case and will be after not to long in the best case.

Step 1. Reformat the sd card and reboot the pi ideally with a screen and keyboard, or if thats not possible then i would suggest doing the following quickly. https://www.raspberrypi.org/documentation/installation/installing-images/

Step 2. Boot the os either ideally with no internet and begin by adding a new user

sudo adduser username


Add the new user to sudo privilages,

sudo visudo


%root      ALL=(ALL:ALL) ALL


Step 3. you want to configure and allow ssh connections either from the gui menu, adding the ssh file to the sd card before boot or using

sudo raspi-config


now you want to edit the sshd config file to deny certain users and allow others

sudo nano /etc/ssh/sshd_config


There are many options but the bare minimum here would be

AllowTcpForwarding yes CHANE TO AllowTcpForwarding no
X11Forwarding yes CHANGE TO X11Forwarding no

DenyUsers  pi