2

I have tried to create a headless connection to my (new) Raspberry Pi, since I do not have a HDMI cable at home. However- after trying everthing I have found as suggestions on Google etc.- I just cannot find a solution to my problem.

My Raspberry is on my local network and ssh is activated, which I can see from:

nmap 192.168.x.x
Nmap scan report for 192.168.x.x
Host is up (0.00018s latency).
Not shown: 999 closed ports
PORT   STATE SERVICE
22/tcp open  ssh

when I type ssh pi@192.168.x.x, and then type raspberry as password, it says: Permission denied, please try again.

When I type: sudo service ssh status, I get:

Dez 27 21:19:24 fritz-HP-Pavilion-17-Notebook-PC sshd[16244]: Failed password for invalid user pi from 192.168.x.x port 45468 ssh2

Dez 27 21:19:42 fitz-HP-Pavilion-17-Notebook-PC sshd[16244]: Connection closed by 192.168.x.x port 45468 [preauth]

PS.: I use Ubuntu 16.04. and on the Raspberry Pi 3, the operating system is Raspbian

Mike Poole
  • 222
  • 1
  • 2
  • 7
BeldCode
  • 21
  • 2

2 Answers2

1

Since it seems that you are using Ubuntu on your host PC, you can inspect the etc/passwd file on the SD card to find out what your username is on the Pi.

cat /media/ubuntu_user/sd_card_partition_2/etc/passwd

You can also check if the default password is what is expected or change the default password by modifying the etc/shadow file on the SD card. The instructions for adding a new user included in the link @Ghanima posted in his comment should work as well.

Update

From your comment, it seems you are trying to install Noobs without a display, perhaps these instructions will work for you. They are a little on the old side, but perhaps they will still work.

My advice would be to download the official Raspbian image which is a lot easier to work with on initial install without a keyboard and monitor.

RubberStamp
  • 1,349
  • 1
  • 8
  • 16
  • I don't why, but when I navigate to the SD Card: `cd /media/user/SETTINGS/`, I only see: `ll` --> `drwxr-xr-x 4 root root 1024 Jan 1 1970 cache/ ` `drwx------ 2 root root 12288 Jan 1 1970 lost+found/ ` `-rw-r--r-- 1 root root 56 Jan 1 1970 noobs.conf ` There is no `/etc/passwd`... Most likely I'm overseeing something... – BeldCode Dec 27 '17 at 22:27
0

Per updated question: This is the likely solution SSH not working with fresh install


Assuming Ubuntu LTS 16.04 running on the Pi:

The default login username is "ubuntu", password is "ubuntu" for Ubuntu LTS 16.04 (Source).

This is the clue that there is no user pi:

Failed password for invalid user pi from 192.168.x.x

So this is your command to go with:

ssh ubuntu@192.168.x.x
Ghanima
  • 15,578
  • 15
  • 58
  • 113
  • I just tried "ssh ubuntu@192.168.x.x". However, it still states "Failed password for invalid user ubuntu from 192.168.0.9 port 45794 ssh2". I tried both, "ubuntu" and "raspberry" as possible passwords. Is is possible to connect to my Pi, when I have never been logged into the pi? In other words: Do I have to set some configurations within the Pi, before I can connect headless with the Pi via another machine? – BeldCode Dec 27 '17 at 21:20
  • According to this site https://medium.com/a-swift-misadventure/how-to-setup-your-raspberry-pi-2-3-with-ubuntu-16-04-without-cables-headlessly-9e3eaad32c01 ubuntu/ubuntu is right and there needs nothing else to be done to ssh. On the other hand this https://www.berthon.eu/2017/installing-ubuntu-server-on-raspberry-pi-headless/ makes much ado about creating an user manually and enabling ssh. Hmm, which is it? – Ghanima Dec 27 '17 at 21:42
  • There has been a chip alongside my Raspberry Pi. A 16GB SD Card with an operating system preinstalled. It is the _Raspbian_ OS if I am not mistaken. The author of https://medium.com/a-swift-misadventure/how-to-setup-your-raspberry-pi-2-3-with-ubuntu-16-04-without-cables-headlessly-9e3eaad32c01 flashes Ubuntu 16.04 server minimal on his SD card. I don't know, if _Raspbian_ OS automatically allows ssh headless connection or not... – BeldCode Dec 27 '17 at 22:03
  • @BeldCode that changes everything. So you're not running Ubuntu on the Pi but Raspbian. (You need to clarify this in your question, it is key here). In this case this should help: https://raspberrypi.stackexchange.com/q/58478/19949 – Ghanima Dec 27 '17 at 22:07
  • I'm sorry I didn't mention that earlier. I had no idea, that it was that important, So, I must enable ssh for my Raspberry Pi 3. In order to do that, I must boot my Pi and set it up, before I can headless connect with it. That means, I must buy a HDMI cable first, right? – BeldCode Dec 27 '17 at 22:17
  • @BeldCode unfortunately Raspbian changed its behaviour to disable ssh unless a file named ssh is present in a certain directory (the link above has it explained). There is however no need for an HDMI cable. Just use your ubuntu PC to mount the SD card and create the file. – Ghanima Dec 27 '17 at 22:24