petercli
Posts: 21
Joined: Sun Nov 01, 2015 7:49 pm

SSH connection timeout ?

Wed Aug 19, 2020 4:09 pm

hi ,

I am trying to enable SSH on my PI3 , using this guide : https://howchoo.com/g/mgi3mdnlnjq/how-t ... pi-via-ssh
i enabled SSH in configuration/interfaces

I set a static IP with correct gateway:
ip r | grep default
default via 192.168.0.1 dev wlan0 src 192.168.0.27 metric 303

But i get a error when I run this command from my windows 10 PC :
ssh pi@192.168.0.27
ssh: connect to host 192.168.0.27 port 22: Connection timed out

Any ideas ?
Is my local router blocking the port?
Thanks,
Peter

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

Re: SSH connection timeout ?

Wed Aug 19, 2020 4:19 pm

petercli wrote:
Wed Aug 19, 2020 4:09 pm
Is my local router blocking the port?
It is common for routers to block access to wireless devices from a wired device on the same LAN.

There may be an option in your router to "Allow local access" or something like that.

Have you tried a simple "ping 192.168.0.27" from the windows PC?
Unreadable squiggle

User avatar
pi-anazazi
Posts: 745
Joined: Fri Feb 13, 2015 9:22 pm
Location: EU

Re: SSH connection timeout ?

Wed Aug 19, 2020 4:20 pm

If the ssh client trying to access the pi is on the same subnet, your router has nothing to do with the traffic.

Show output of

Code: Select all

ip a
on the raspi and

Code: Select all

ps aux | grep ssh
PS: good catch, didn't see wlan0, wireless isolation might be an issue, but the question is: do you really want to turn off this security feature?
Kind regards

anazazi

petercli
Posts: 21
Joined: Sun Nov 01, 2015 7:49 pm

Re: SSH connection timeout ?

Wed Aug 19, 2020 5:00 pm

Thanks for the 2 replies.

Sounds like i should use wired SSH instead of wireless, right?

Ping on same lan gives error :
C:\>ping 192.168.0.27

Pinging 192.168.0.27 with 32 bytes of data:
Reply from 192.168.0.24: Destination host unreachable.
Reply from 192.168.0.24: Destination host unreachable.



pi@peterpi:~ $ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether b8:27:eb:56:bc:4e brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:03:e9:1b brd ff:ff:ff:ff:ff:ff
inet 192.168.0.27/24 brd 192.168.0.255 scope global noprefixroute wlan0
valid_lft forever preferred_lft forever
inet6 fe80::9f0b:822:3dfd:6988/64 scope link
valid_lft forever preferred_lft forever
pi@peterpi:~ $


pi@peterpi:~ $ ps aux | grep ssh
root 460 0.0 0.5 10724 5332 ? Ss 09:50 0:00 /usr/sbin/sshd -D
pi 572 0.0 0.0 4520 288 ? Ss 09:50 0:00 /usr/bin/ssh-agent x-session-manager
pi 705 0.0 0.0 4520 288 ? Ss 09:50 0:00 /usr/bin/ssh-agent -s
pi 1275 0.0 0.0 7348 576 pts/0 S+ 09:54 0:00 grep --color=auto ssh

pi@peterpi:~ $

Return to “Troubleshooting”