I was trying to setup a ssh connection to my pi 2 (model B, i.e., no inbuilt wifi) in headless mode from my ubuntu machine. I do not have a router. After multiple attempts of flashing and tweaking, the following worked,

  1. Add ssh file in /boot
  2. Uncommenting the following lines in /etc/dhcpcd.conf
profile static_eth0
static ip_address=
static routers=
static domain_name_servers=

interface eth0
fallback static_eth0

After this it asks for

[email protected]'s password:

to which i supplied the default password for rpi


but it keeps saying Permission denied, please try again.for three times after which it closes the connection. I tried this and this, but it would not work. Note that I do not have a windows machine or a hdmi-in enabled screen. I don't remember having this problem in earlier versions of raspbian. I am using 2018-11-13-raspbian-stretch-full.img.

  • @Milliways I connected my rpi to my laptop via an ethernet cable after adding the empty ssh file in /boot/. However, I was not able to establish a ssh connection via the command $ssh pi@raspberrypi as it would say Could not resolve hostname raspberrypi: Name or service not known. After making a static IP in /etc/dhcpcd.conf I was able to connect but now I think I am not getting access to the default user, hence it's not accepting the default password.
    Commented Jan 10, 2019 at 9:08
  • You do not put ssh in /boot but into the boot partition. You should use raspberrypi.local in most OS. See How to set up networking/WiFi
    – Milliways
    Commented Jan 10, 2019 at 9:13
  • @Milliways sorry, my bad. I put ssh into the boot partition only after flashing the image file. And I tried both $ssh pi@raspberrypi and $ssh [email protected]. Since this problem did not occur before when I used this with windows + putty, I assumed it has something to do with the DHCP connection on my laptop hence I gave it a static IP. I dont know much about DHCP hence I avoid it :p
    Commented Jan 10, 2019 at 9:20
  • 2
    try running ssh -vvv as this will give more verbose output which help work out why permission is denied. You can disable passwords in sshd_config.
    – user72404
    Commented Jan 10, 2019 at 9:45
  • @Milliways I reflashed the os added the file and restarted my computer. It worked with $ssh [email protected] and it started working fine with it. I think the problem was with my ubuntu machine dhcp earlier. Thanks!
    Commented Jan 10, 2019 at 11:54

2 Answers 2


When I did,

$ssh [email protected]

after making my IP static, pi gave the following,

[email protected]'s password:

Which was misleading, as no user exists. Hence it kept showing Permission Denied. It would ask passwords for this user, even when I had disabled passwords.

Finally, after restarting my computer and re-flashing the OS on the SD card, I was able to get it working without static IP. And the standard command worked,

$ssh [email protected]

I figured that DHCP must have been misbehaving on my computer as I kept switching my ethernet port from RPI to LAN. After restarting it must have got reset.

  • 2
    "as no user exists" – is the host, not the user. Commented May 21, 2022 at 7:53

No more default pi user with raspberry password.


  • True, but this doesn't answer the question of a problem in 2019. This is more of a comment.
    – Chenmunka
    Commented Jul 19, 2022 at 7:29
  • 1
    I had this kind of problem and I'd like to find this kind of answer here, as the search engine suggests this page. Commented Jul 19, 2022 at 20:39

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.