ssh connection: ran 'sshd' yet 'port 22: Connection refused'
Specs
- Hardware: Software
- Galaxy Tab A7 Lite (model name: SM-T220): Android 14
- Raspberry Pi 5 (8GB): Raspberry Pi OS
Msg
Hello, I was trying to use ssh with these 2 devices: here's what happened:
- Android device (host):
- Raspberry Pi (client)
What I've tried
- both devices connected to same WiFi network (I checked the ip address assigned to the Android device by the router in its Wifi Settings); I also checked the router 'dashboard' (the settings you're able to change just by accessing its local ip address)
- in Termux
- execute
whoami
and passwd
beforehand
- see if anything came up in logcat -s 'sshd:*'
while connecting (but nothing was outputted for some reason)Solution:Jump to solution
you'll need to connect to different port
and then on your raspberry pi, connect to it on port 8022...
3 Replies
alinuxchap@libertus-desktop:~ $ ping 192.168.1.76
PING 192.168.1.76 (192.168.1.76) 56(84) bytes of data.
64 bytes from 192.168.1.76: icmp_seq=1 ttl=64 time=98.6 ms
64 bytes from 192.168.1.76: icmp_seq=2 ttl=64 time=17.7 ms
64 bytes from 192.168.1.76: icmp_seq=3 ttl=64 time=313 ms
64 bytes from 192.168.1.76: icmp_seq=4 ttl=64 time=306 ms
64 bytes from 192.168.1.76: icmp_seq=5 ttl=64 time=330 ms
64 bytes from 192.168.1.76: icmp_seq=6 ttl=64 time=352 ms
64 bytes from 192.168.1.76: icmp_seq=7 ttl=64 time=49.3 ms
^C
--- 192.168.1.76 ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6008ms
rtt min/avg/max/mdev = 17.663/209.519/351.540/136.062 ms
Solution
you'll need to connect to different port
and then on your raspberry pi, connect to it on port 8022
Thanks, didn't realise for sshd it was as simple as using the '-p' option (identical to ssh) since there wasn't an example of it here: https://wiki.termux.com/wiki/Remote_Access, so I missed that 'test'