magicalDuck
Posts: 25
Joined: Mon Oct 09, 2017 6:45 am

cannot ssh into my raspberry pi zero W

Sun Jan 14, 2018 12:18 pm

Hi,

So I downloaded the latest raspian lite, etched it to a sd card, plug the raspi to a screen and keyboad
booted and logged in with pi/raspberry

typed 'sudo raspi-config'
changed my keyboard to azerty
changed hostname to "rpcam1"
added a wifi network
rebooted

logged in again
check that I was connected to my wifi with : ifconfig wlan0 -> all good
went into 'sudo raspi-config' again
enabled shh (by the way will this be enabled after each reboot?, will I have to login for shh to be enabled?)
did not reboot the pi zero

on windows 10x64 :
opened cmd, pinged rpcam1 -> sucess

Code: Select all

ping rpcam1

Envoi d’une requête 'ping' sur rpcam1.home [2a01:cb04:319:8b00:95d1:c57f:15bb:98cc] avec 32 octets de données :
Réponse de 2a01:cb04:319:8b00:95d1:c57f:15bb:98cc : temps=6 ms
Réponse de 2a01:cb04:319:8b00:95d1:c57f:15bb:98cc : temps=9 ms
Réponse de 2a01:cb04:319:8b00:95d1:c57f:15bb:98cc : temps=4 ms
Réponse de 2a01:cb04:319:8b00:95d1:c57f:15bb:98cc : temps=13 ms

Statistiques Ping pour 2a01:cb04:319:8b00:95d1:c57f:15bb:98cc:
    Paquets : envoyés = 4, reçus = 4, perdus = 0 (perte 0%),
Durée approximative des boucles en millisecondes :
    Minimum = 4ms, Maximum = 13ms, Moyenne = 8ms
opened putty, put rpcam1 in hostname, left port to 22, connection type : SSH
also tried those hostname :
rpcam1.local
rpcam1.home
pi@rpcam1
pi@rpcam1.local
pi@rpcam1.home
192.168.1.35 (got that IP on the raspi with ifconfig)

then I installed the "apple bonjour" thing on my windows 10 an tried again, I always get the same thing :

'network error : software caused connection abort'

Note that if I input 'rpcam2' (which does not exist) I get a different message (no such hostname or something)

did I do something wrong?

Thanks.

User avatar
DougieLawson
Posts: 40254
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: cannot ssh into my raspberry pi zero W

Sun Jan 14, 2018 12:30 pm

try ssh -4 pi@192.168.1.35
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

magicalDuck
Posts: 25
Joined: Mon Oct 09, 2017 6:45 am

Re: cannot ssh into my raspberry pi zero W

Sun Jan 14, 2018 12:43 pm

I don't think I can do that with putty on windows

User avatar
DougieLawson
Posts: 40254
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: cannot ssh into my raspberry pi zero W

Sun Jan 14, 2018 12:53 pm

magicalDuck wrote:
Sun Jan 14, 2018 12:43 pm
I don't think I can do that with putty on windows
Yes you can. You can code the IP address as dotted decimal (or IPv6 full or abbreviated format) in Putty. Your Raspberry will then ask for the userid to login.

You can't explicitly set IPv6 or IPv4 but PuTTY will assume that from the address format.

Also try raspberrypi.local (which should work if you have iTunes installed) as the Avahi daemon is enabled by default on your Raspbian system.
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

magicalDuck
Posts: 25
Joined: Mon Oct 09, 2017 6:45 am

Re: cannot ssh into my raspberry pi zero W

Sun Jan 14, 2018 1:03 pm

No I was reffering to 'ssh -4'
raspberry.local is not found but that is normal since I renamed the hostname to rpcam1
using 192.168.1.35 or pi@192.168.1.35 does the same error
Last edited by magicalDuck on Sun Jan 14, 2018 1:05 pm, edited 1 time in total.

User avatar
DougieLawson
Posts: 40254
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: cannot ssh into my raspberry pi zero W

Sun Jan 14, 2018 1:04 pm

Try rpcam1.local that address should be exposed if you have iTunes and if your Raspberry is running avahi-daemon.
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

magicalDuck
Posts: 25
Joined: Mon Oct 09, 2017 6:45 am

Re: cannot ssh into my raspberry pi zero W

Sun Jan 14, 2018 1:06 pm

all those give the same error :
rpcam1
rpcam1.local
rpcam1.home
pi@rpcam1
pi@rpcam1.local
pi@rpcam1.home
192.168.1.35 (got that IP on the raspi with ifconfig)
pi@192.168.1.35
I don't have itunes but I installed the bonjour service

User avatar
DougieLawson
Posts: 40254
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: cannot ssh into my raspberry pi zero W

Sun Jan 14, 2018 1:17 pm

In that case you need to connect your RPi to a TV with a USB mouse and keyboard. It's going to need some investigation on the RPi

ip addr show
ip route
ping -c3 $(ip route | awk '/default/ {print $3}')
ping -c3 8.8.8.8
ping -c3 google.com
cat /etc/resolv.conf
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

magicalDuck
Posts: 25
Joined: Mon Oct 09, 2017 6:45 am

Re: cannot ssh into my raspberry pi zero W

Sun Jan 14, 2018 2:46 pm

here are the results

Image

User avatar
DougieLawson
Posts: 40254
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: cannot ssh into my raspberry pi zero W

Sun Jan 14, 2018 3:02 pm

So the networking from your RPi to your router and out to the big wild internet is working perfectly.

Is your laptop on the same network? Does your router have a firewall between devices? Does Windows have a firewall that's (silently) blocking PuTTY? Have you told Windows that you're on a private network and it's OK to see and connect to other machines within 192.168.1.0/24?

https://tinkertry.com/how-to-change-win ... to-private
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

magicalDuck
Posts: 25
Joined: Mon Oct 09, 2017 6:45 am

Re: cannot ssh into my raspberry pi zero W

Sun Jan 14, 2018 6:00 pm

Router config looks good.
I'm using my desktop which is connected to my router by ethernet in order to try to SSH to my raspberry pi zero W via WIFI.

My windows network setup was set to public, I switched it to private and tried with both windows firewall ON and OFF, each time I get this now :

"network error : software caused connection abort"
and it's OK to see and connect to other machines within 192.168.1.0/24?
not sure about that.

robjak
Posts: 26
Joined: Sun Mar 12, 2017 7:22 pm

Re: cannot ssh into my raspberry pi zero W

Sun Jan 14, 2018 7:43 pm

What happens when you run this command on the pi:

ssh localhost

magicalDuck
Posts: 25
Joined: Mon Oct 09, 2017 6:45 am

Re: cannot ssh into my raspberry pi zero W

Sun Jan 14, 2018 9:33 pm

robjak wrote:
Sun Jan 14, 2018 7:43 pm
What happens when you run this command on the pi:

ssh localhost
connection reset by ::1 port 22

robjak
Posts: 26
Joined: Sun Mar 12, 2017 7:22 pm

Re: cannot ssh into my raspberry pi zero W

Sun Jan 14, 2018 10:36 pm

Try this:
~ $ sudo systemctl enable ssh
~ $ sudo systemctl start ssh

then
~ $ ssh localhost to test

If it doesnt work
then

reinstall ssh server

~ $ apt-get install --reinstall openssh

robjak
Posts: 26
Joined: Sun Mar 12, 2017 7:22 pm

Re: cannot ssh into my raspberry pi zero W

Mon Jan 15, 2018 12:03 am

~ $ sudo apt-get install --reinstall openssh

magicalDuck
Posts: 25
Joined: Mon Oct 09, 2017 6:45 am

Re: cannot ssh into my raspberry pi zero W

Mon Jan 15, 2018 8:29 am

still not working and won't reinstall :

Image

Which is weird because I did a 'sudo apt-get update' and 'sudo apt-get upgrade' before

User avatar
rpdom
Posts: 17741
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: cannot ssh into my raspberry pi zero W

Mon Jan 15, 2018 8:31 am

The package is called openssh, not openshh.

magicalDuck
Posts: 25
Joined: Mon Oct 09, 2017 6:45 am

Re: cannot ssh into my raspberry pi zero W

Mon Jan 15, 2018 9:54 am

woops, sorry I had just woke up and I wasn't wearing my glasses :oops:

I'll try again when I get back from work, in 10h

magicalDuck
Posts: 25
Joined: Mon Oct 09, 2017 6:45 am

Re: cannot ssh into my raspberry pi zero W

Mon Jan 15, 2018 6:48 pm

Image

Well, that is weird, double checked the spelling 3 times

User avatar
DougieLawson
Posts: 40254
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: cannot ssh into my raspberry pi zero W

Mon Jan 15, 2018 6:54 pm

If you don't know the name of a package try using the search function

apt search sshd

Code: Select all

pi@mercury:~ $ apt search sshd
Sorting... Done
Full Text Search... Done
fail2ban/stable 0.9.6-2 all
  ban hosts that cause multiple authentication errors

libconfig-model-cursesui-perl/stable 1.105-1 all
  curses interface to edit config data through Config::Model

libconfig-model-openssh-perl/stable 1.237-1 all
  configuration editor for OpenSsh

libconfig-model-tkui-perl/stable 1.361-1 all
  Tk GUI to edit config data through Config::Model

openssh-server/stable,now 1:7.4p1-10+deb9u2 armhf [installed,automatic]
  secure shell (SSH) server, for secure access from remote machines

python-logsparser/stable 0.4-1 all
  Python library for log parsing, tagging and analysis.

pi@mercury:~ $
There's a sane result within that list.
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

robjak
Posts: 26
Joined: Sun Mar 12, 2017 7:22 pm

Re: cannot ssh into my raspberry pi zero W

Mon Jan 15, 2018 7:16 pm

~ $ sudo apt-get install --reinstall openssh-server

my bad, thought it was just openssh.

magicalDuck
Posts: 25
Joined: Mon Oct 09, 2017 6:45 am

Re: cannot ssh into my raspberry pi zero W

Mon Jan 15, 2018 7:25 pm

ok so I reinstalled 'ssh' wich contains the openssh-server and client
I rebooted, reactivated ssh and it still wasn't working

So I went there https://downloads.raspberrypi.org/raspbian_lite/images/
And I downloaded then etched an older version : 2017-07-05-raspbian-jessie-lite.zip

I re-configured the wifi, changed the hostname, and activated ssh.

And IT WORKS! i can now on my windows 10 with putty connect to rpcam1, no problems.

I don't know what was the problem and I don't have more time to waste to investigate, I lost 3 days with this while I had other stuff to do :/
I want to thank you all for your help, the community really is nice here :D

User avatar
rpdom
Posts: 17741
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: cannot ssh into my raspberry pi zero W

Mon Jan 15, 2018 9:12 pm

robjak wrote:
Mon Jan 15, 2018 7:16 pm
~ $ sudo apt-get install --reinstall openssh-server

my bad, thought it was just openssh.
Mine too. I didn't bother to check. I thought there was an openssh meta-package that installed the openssh-server and openssh-client packages.

Return to “Troubleshooting”