DinksDad
Posts: 38
Joined: Sat Mar 24, 2018 10:18 am
Location: Surrey. UK.

connections: SSH not working headless.

Mon Apr 30, 2018 10:47 am

Hi.
I am trying to connect my Pi to my PC (win 10).
I have entered the details to connect using puTTy.
Username - pi, password raspberry.
But all i get is a message saying, "access denied".
Any help would be appreciated.
Attachments
oh really 2.jpg
oh really 2.jpg (92.06 KiB) Viewed 4070 times
oh really 1.jpg
oh really 1.jpg (170.23 KiB) Viewed 4070 times
Not very good with a Rasp Pi.

scotty101
Posts: 4106
Joined: Fri Jun 08, 2012 6:03 pm

Re: connections

Mon Apr 30, 2018 11:17 am

Did you enable SSH on the Pi?

https://www.raspberrypi.org/documentati ... ccess/ssh/

Have you tried accessing your Pi using it's IP address rather than the .local name?
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

DinksDad
Posts: 38
Joined: Sat Mar 24, 2018 10:18 am
Location: Surrey. UK.

Re: connections

Mon Apr 30, 2018 11:35 am

No.
As I can't connect the Pi to a monitor etc whilst trying to set up a connection through my pc.
Not very good with a Rasp Pi.

drgeoff
Posts: 11247
Joined: Wed Jan 25, 2012 6:39 pm

Re: connections

Mon Apr 30, 2018 11:40 am

DinksDad wrote:
Mon Apr 30, 2018 11:35 am
No.
As I can't connect the Pi to a monitor etc whilst trying to set up a connection through my pc.
Read section 3 of https://www.raspberrypi.org/documentati ... /README.md
Quis custodiet ipsos custodes?

DinksDad
Posts: 38
Joined: Sat Mar 24, 2018 10:18 am
Location: Surrey. UK.

Re: connections

Mon Apr 30, 2018 11:45 am

That's all fair well.
But i can't access the Pi while trying to connect it to my PC?
How can I change settings on the Pi if I'm trying to connect to a PC?
Not very good with a Rasp Pi.

pcmanbob
Posts: 10177
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: connections

Mon Apr 30, 2018 11:50 am

Did you even bother to read the information on the linked page

3. Enable SSH on a headless Raspberry Pi (add file to SD card on another machine)
For headless setup, SSH can be enabled by placing a file named ssh, without any extension, onto the boot partition of the SD card from another computer. When the Pi boots, it looks for the ssh file. If it is found, SSH is enabled and the file is deleted. The content of the file does not matter; it could contain text, or nothing at all.

If you have loaded Raspbian onto a blank SD card, you will have two partitions. The first one, which is the smaller one, is the boot partition. Place the file into this one.

If you are using a Windows pc this is the only partition on the SD card windows can see.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

fruitoftheloom
Posts: 24587
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: connections

Mon Apr 30, 2018 12:04 pm

pcmanbob wrote:
Mon Apr 30, 2018 11:50 am
Did you even bother to read the information on the linked page

3. Enable SSH on a headless Raspberry Pi (add file to SD card on another machine)
For headless setup, SSH can be enabled by placing a file named ssh, without any extension, onto the boot partition of the SD card from another computer. When the Pi boots, it looks for the ssh file. If it is found, SSH is enabled and the file is deleted. The content of the file does not matter; it could contain text, or nothing at all.

If you have loaded Raspbian onto a blank SD card, you will have two partitions. The first one, which is the smaller one, is the boot partition. Place the file into this one.

If you are using a Windows pc this is the only partition on the SD card windows can see.

Though if used NoobS to install Raspbian:

https://github.com/raspberrypi/noobs/bl ... /README.md
Thinking outside the box is better than burying your head in the sand...

jbudd
Posts: 1505
Joined: Mon Dec 16, 2013 10:23 am

Re: connections: SSH not working headless.

Mon Apr 30, 2018 2:58 pm

Though if [you] used NoobS to install Raspbian:

https://github.com/raspberrypi/noobs/bl ... /README.md
If you did use NOOBS, I suggest you start again with the Raspbian image and burn it to SD with Etcher.
While the SD card is in your PC, put an empty file "ssh" or "ssh.txt" in the partition that Windows can understand, where "config.txt" and "cmdline.txt" are.

NOOBS either "... makes it easy to select and install operating systems for the Raspberry Pi without having to worry about manually imaging your SD card." or "... is a pain in the butt", depending on your point of view.

I personally dislike Putty because it gets in between me and the Linux interface. The "access denied" message comes from Putty not the Pi.
Instead I use MobaXterm. I type ssh pi@192.168.1.nnn (Use IPScan24 on Windows or Fing on a phone to find the actual IP address).
If ssh is not enabled I get "Connection refused", if I remember correctly.
If the password is wrong I get no message but the password prompt again.

DinksDad
Posts: 38
Joined: Sat Mar 24, 2018 10:18 am
Location: Surrey. UK.

Re: connections: SSH not working headless.

Mon Apr 30, 2018 3:23 pm

I only used PUTTY, as an online search told me to.
I have just installed MOBAXTERM, and that has come up with same result, ACCESS DENIED.

jbudd wrote:
Mon Apr 30, 2018 2:58 pm
Though if [you] used NoobS to install Raspbian:

https://github.com/raspberrypi/noobs/bl ... /README.md
If you did use NOOBS, I suggest you start again with the Raspbian image and burn it to SD with Etcher.
While the SD card is in your PC, put an empty file "ssh" or "ssh.txt" in the partition that Windows can understand, where "config.txt" and "cmdline.txt" are.

NOOBS either "... makes it easy to select and install operating systems for the Raspberry Pi without having to worry about manually imaging your SD card." or "... is a pain in the butt", depending on your point of view.

I personally dislike Putty because it gets in between me and the Linux interface. The "access denied" message comes from Putty not the Pi.
Instead I use MobaXterm. I type ssh pi@192.168.1.nnn (Use IPScan24 on Windows or Fing on a phone to find the actual IP address).
If ssh is not enabled I get "Connection refused", if I remember correctly.
If the password is wrong I get no message but the password prompt again.
Not very good with a Rasp Pi.

DinksDad
Posts: 38
Joined: Sat Mar 24, 2018 10:18 am
Location: Surrey. UK.

Re: connections

Mon Apr 30, 2018 3:26 pm

WOW. That was a reply.
I haven't been able to sort this, as I am extremely new to the Pi and have only recently been able to get on to trying this connection method.

pcmanbob wrote:
Mon Apr 30, 2018 11:50 am
Did you even bother to read the information on the linked page

3. Enable SSH on a headless Raspberry Pi (add file to SD card on another machine)
For headless setup, SSH can be enabled by placing a file named ssh, without any extension, onto the boot partition of the SD card from another computer. When the Pi boots, it looks for the ssh file. If it is found, SSH is enabled and the file is deleted. The content of the file does not matter; it could contain text, or nothing at all.

If you have loaded Raspbian onto a blank SD card, you will have two partitions. The first one, which is the smaller one, is the boot partition. Place the file into this one.

If you are using a Windows pc this is the only partition on the SD card windows can see.
Not very good with a Rasp Pi.

jbudd
Posts: 1505
Joined: Mon Dec 16, 2013 10:23 am

Re: connections: SSH not working headless.

Mon Apr 30, 2018 4:12 pm

I have no idea if there will be useful information revealed, but in MobaXterm (maybe Putty too) you can do eg
ssh -v pi@raspberrypi.local

It should spout out a lot of debug info.
ssh -vv and ssh -vvv are available too.

User avatar
B.Goode
Posts: 10727
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: connections: SSH not working headless.

Mon Apr 30, 2018 4:31 pm

But all i get is a message saying, "access denied".
Any help would be appreciated.
There are only a small number of trivial explanations.

Maybe you have removed or renamed the default pi username on the target RPi.

Maybe you have mis-remembered or mistyped the password for the pi username. If you have not changed it, it will be raspberry. If you have changed the password to something of your own choosing then only you know what it should be...

Or maybe for some reason raspberrypi.local is connecting to a machine that is not your RPi. Hence the advice to connect via the actual IP address that your network has assigned to the RPi.

jbudd
Posts: 1505
Joined: Mon Dec 16, 2013 10:23 am

Re: connections: SSH not working headless.

Mon Apr 30, 2018 4:44 pm

I have seen posts that suggest if you pull out the plug on a the first boot of a new Raspbian installation before ssh has finished setting up, something gets messed up and you have to re-image the SD card.

With Putty, if you hold down CTRL and right click in the Putty window you can select "Event Log". For example
Untitled 2.jpg
Untitled 2.jpg (135.58 KiB) Viewed 3903 times

User avatar
B.Goode
Posts: 10727
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: connections: SSH not working headless.

Mon Apr 30, 2018 4:50 pm

With Putty, if you hold down CTRL and right click in the Putty window you can select "Event Log".

Now that's a useful snippet I was unaware of. Thanks!

pcmanbob
Posts: 10177
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: connections: SSH not working headless.

Mon Apr 30, 2018 5:15 pm

OK dummies guide to setting up a pi headless using windows pc

1 . Download raspbian image from here https://www.raspberrypi.org/downloads/raspbian/
if you don't want a desktop download the lite version , if you want a desktop the download the with desktop version.

2 . download and install etcher from here https://etcher.io/

3 . Insert SD card in to USB card reader and connect you windows pc

4 . Use etcher to write image to SD card no need to un-zip the image file or format the card ( note all data on the card will be lost when you do this. )

5 . Depending on windows version you may need to eject the SD card reader and reconnect it for windows to see the SD card if windows asks you to format the card just cancel the format.
now create a file call ssh or ssh.txt in the directory shown by windows.

6 . Eject SD card reader and place SD card in pi. connect LAN cable between pi and and your router/network switch, power up pi
allow time for pi to boot and then reboot may take several mins on an older pi if you are running the raspbian with desktop version.

7 . log on to router and go to connected devices page and look for the pi IP address.

8 . open putty on you windows pc and enter the pi IP address in the Host Name ( or IP address field ), click open
If all went well you should be connected to you pi command line enter user name of pi and the password raspberry

its as simple and easy as that.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: connections: SSH not working headless.

Mon Apr 30, 2018 6:57 pm

and also check if the [Caps Lock] LED is NOT ON
when you type the password

DinksDad
Posts: 38
Joined: Sat Mar 24, 2018 10:18 am
Location: Surrey. UK.

Re: connections: SSH not working headless.

Tue May 01, 2018 7:49 am

thanks. i haven't change anything on the pi. to be honest i haven't really been on it much at all. was waiting to get it all set up. wanted to connect it to an old tft tv i've got, via the yellow rca cable, but that doesn't work either. so thought i'd give it a go connecting it to my pc, to share the monitor. but that's turned out to be a nightmare.
B.Goode wrote:
Mon Apr 30, 2018 4:31 pm
But all i get is a message saying, "access denied".
Any help would be appreciated.
There are only a small number of trivial explanations.

Maybe you have removed or renamed the default pi username on the target RPi.

Maybe you have mis-remembered or mistyped the password for the pi username. If you have not changed it, it will be raspberry. If you have changed the password to something of your own choosing then only you know what it should be...

Or maybe for some reason raspberrypi.local is connecting to a machine that is not your RPi. Hence the advice to connect via the actual IP address that your network has assigned to the RPi.
Not very good with a Rasp Pi.

DinksDad
Posts: 38
Joined: Sat Mar 24, 2018 10:18 am
Location: Surrey. UK.

Re: connections: SSH not working headless.

Tue May 01, 2018 7:50 am

have made sure of that, too.
KLL wrote:
Mon Apr 30, 2018 6:57 pm
and also check if the [Caps Lock] LED is NOT ON
when you type the password
Not very good with a Rasp Pi.

User avatar
B.Goode
Posts: 10727
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: connections: SSH not working headless.

Tue May 01, 2018 8:17 am

Previously I wrote:
There are only a small number of trivial explanations.
So here's one that is not so trivial...

Raspbian is set up to expect a UK keyboard by default.

From the mindset of someone from the UK, is there anything 'unusual' about the keyboard on your Windows system? For example, a French 'azerty' keyboard would scramble some of the characters in the default raspberry password.

DinksDad
Posts: 38
Joined: Sat Mar 24, 2018 10:18 am
Location: Surrey. UK.

Re: connections: SSH not working headless.

Tue May 01, 2018 10:01 am

thanks. very informative. i have decided to completely format my 32gb sd card, & install another complete NOOBS version. i'll start from there.
pcmanbob wrote:
Mon Apr 30, 2018 5:15 pm
OK dummies guide to setting up a pi headless using windows pc

1 . Download raspbian image from here https://www.raspberrypi.org/downloads/raspbian/
if you don't want a desktop download the lite version , if you want a desktop the download the with desktop version.

2 . download and install etcher from here https://etcher.io/

3 . Insert SD card in to USB card reader and connect you windows pc

4 . Use etcher to write image to SD card no need to un-zip the image file or format the card ( note all data on the card will be lost when you do this. )

5 . Depending on windows version you may need to eject the SD card reader and reconnect it for windows to see the SD card if windows asks you to format the card just cancel the format.
now create a file call ssh or ssh.txt in the directory shown by windows.

6 . Eject SD card reader and place SD card in pi. connect LAN cable between pi and and your router/network switch, power up pi
allow time for pi to boot and then reboot may take several mins on an older pi if you are running the raspbian with desktop version.

7 . log on to router and go to connected devices page and look for the pi IP address.

8 . open putty on you windows pc and enter the pi IP address in the Host Name ( or IP address field ), click open
If all went well you should be connected to you pi command line enter user name of pi and the password raspberry

its as simple and easy as that.
Not very good with a Rasp Pi.

User avatar
B.Goode
Posts: 10727
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: connections: SSH not working headless.

Tue May 01, 2018 10:04 am

thanks. very informative. i have decided to completely format my 32gb sd card, & install another complete NOOBS version. i'll start from there.
If you start from "there", ie. the tutorial that follows, you will not install NOOBS.

jbudd
Posts: 1505
Joined: Mon Dec 16, 2013 10:23 am

Re: connections: SSH not working headless.

Tue May 01, 2018 10:05 am

I think you'll find the alternative to noobs, as pcmanbob suggested, less troublesome.

DinksDad
Posts: 38
Joined: Sat Mar 24, 2018 10:18 am
Location: Surrey. UK.

Re: connections: SSH not working headless.

Tue May 01, 2018 10:07 am

NOOBS, no good then?
jbudd wrote:
Tue May 01, 2018 10:05 am
I think you'll find the alternative to noobs, as pcmanbob suggested, less troublesome.
Not very good with a Rasp Pi.

jbudd
Posts: 1505
Joined: Mon Dec 16, 2013 10:23 am

Re: connections: SSH not working headless.

Tue May 01, 2018 10:12 am

NOOBS, no good then?
I wouldn't say that, but you do see a lot of posts here from people having trouble with it.

Edit: Especially when the Pi has no keyboard/monitor connected - "headless".
Use the Raspbian image / Etcher method.
Last edited by jbudd on Tue May 01, 2018 10:25 am, edited 1 time in total.

User avatar
B.Goode
Posts: 10727
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: connections: SSH not working headless.

Tue May 01, 2018 10:13 am

When this topic was opened 24 hours ago @dinksdad wrote:
I am trying to connect my Pi to my PC (win 10).
I have entered the details to connect using puTTy.
I've just had a possible insight based on recent posts...

Is it possible that you are trying to use the NOOBS Installer to install an Operating System, such as Raspbian, 'headlessly'?

Because although possible, with lots of hoop-jumping, it really isn't sensible: the NOOBS Installer is fundamentally a GUI tool and needs a directly connected monitor and keyboard.

If you haven't yet installed Raspbian but are trying to connect to the NOOBS Recovery Console via SSH/putty that would explain the failed login.

Return to “Beginners”