ancris00
Posts: 52
Joined: Sun Jan 19, 2020 8:56 pm
Location: Miranda de Ebro, Spain

How to connect (throught SSH) to the Pi throught mobile phone

Mon May 18, 2020 5:49 pm

Hi all,
I have connected my Pi to internet througt a phone.
The phone is sharing the connection to the Pi
Because the Pi does not receive the conection througt a router,
how can I connect to the Pi via/throught SSH?

See the picture

Thanks
Attachments
Captura.JPG
Captura.JPG (122.4 KiB) Viewed 871 times
:lol: :lol: Pi 4 Model B :lol: :lol:
Raspbian Buster with desktop 4.19

luckydog
Posts: 20
Joined: Sun Mar 03, 2019 7:07 pm

Re: How to connect (throught SSH) to the Pi throught mobile phone

Mon May 18, 2020 6:29 pm

Hi, have you tried finding the ip address using fing or angry ip?

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

Re: How to connect (throught SSH) to the Pi throught mobile phone

Mon May 18, 2020 7:08 pm

ancris00 wrote:
Mon May 18, 2020 5:49 pm
how can I connect to the Pi via/throught SSH?
ssh from what device? The phone? Another computer?

jfirestorm44
Posts: 18
Joined: Tue Apr 21, 2020 5:45 pm

Re: How to connect (throught SSH) to the Pi throught mobile phone

Tue May 19, 2020 1:13 am

Unless there some restriction while you’re phone is being used as a hotspot you can use Termius App to connect. You’ll need to use something like Puttygen to make the public/private keys and then transfer the private key to your phone. iTunes is probably the best method for that but you can also use a cloud service to get it there. Just keep in mind if the key is intercepted while transferring to your phone it become compromised. Once you have the key on your phone, and the public on the Pi, create a host in the app with all of the correct data and add the key. If you did it right you’ll be taken to your Pis command prompt.

(This is of course if you were referring to using your phone for SSH.)

ancris00
Posts: 52
Joined: Sun Jan 19, 2020 8:56 pm
Location: Miranda de Ebro, Spain

Re: How to connect (throught SSH) to the Pi throught mobile phone

Tue May 19, 2020 1:06 pm

thank you luckydog, drgeoff, jfirestorm44,
May be it was not very good explained. I hope picture 1 help.

I run Termius (see picture 2) on the pc and it does not connect to the pi

Any help?
Attachments
2.jpg
2.jpg (78 KiB) Viewed 740 times
1.jpg
1.jpg (31.85 KiB) Viewed 740 times
:lol: :lol: Pi 4 Model B :lol: :lol:
Raspbian Buster with desktop 4.19

User avatar
dickon
Posts: 1452
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: How to connect (throught SSH) to the Pi throught mobile phone

Tue May 19, 2020 1:28 pm

I may regret asking this, but what IP address does the Pi think it has, and what IP address does your PC think it has?

Chances are, both your devices are being NATted, which makes communication between them extremely difficult. My phone, on Vodafone here in the UK, is given a 10.* number, which is NATted, and I know most mobile networks worldwide do the same thing. Your fibre ISP may issue you with a proper IP address, but that'll be on their side of your home router, with that router also NATting. As the carrier is doing the NAT, you can't put a port-forward in to allow inbound connections to the Pi, and although you may be able to do something similar on the PC, that will involve installing some sort of ssh server on your PC (under Windows? Don't ask me how -- I don't use it), and getting the Pi to poll once in a while.

NAT sucks. CGNAT sucks at carrier-grade levels.

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

Re: How to connect (throught SSH) to the Pi throught mobile phone

Tue May 19, 2020 3:00 pm

ancris00 wrote:
Tue May 19, 2020 1:06 pm
thank you luckydog, drgeoff, jfirestorm44,
May be it was not very good explained. I hope picture 1 help.

I run Termius (see picture 2) on the pc and it does not connect to the pi

Any help?

As Dickon stated above what you envisage is not feasible.


Why not just use RealVNC Connect which is included in Raspbian Buster with Desktop ??

https://www.realvnc.com/en/raspberrypi/
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

scottyanke
Posts: 8
Joined: Sun Aug 04, 2019 8:55 pm
Location: Minnesota

Re: How to connect (throught SSH) to the Pi throught mobile phone

Sun May 24, 2020 4:38 pm

It looks like you have a Pi 4, so you'd have bluetooth available. I use an Android Serial Bluetooth app when I need to do simple things on my Pi's, like getting the IP address, rebooting, checking program status, etc. To use any bluetooth app as a console, you'd need to take the steps laid out in https://hacks.mozilla.org/2017/02/headl ... bluetooth/. It's worked for me on multiple Pi systems, as long as I'm within 30 feet of the device. It cost nothing. Note that the app doesn't have the ability to use a control key (on my phone, anyway) so editing with nano would be a challenge. But you don't need a router, or even an IP connection to do some console work on the Pi from your phone.

WiFi
Posts: 31
Joined: Sat Oct 19, 2013 6:01 pm

Re: How to connect (throught SSH) to the Pi throught mobile phone

Tue May 26, 2020 12:36 pm

I would like to recomend TERMUX instead (Termius might offer more convenience - but basics are much to poor and convenience asks for very high monthly reccuring fees).

TERMUX is offering a nearly perfect (emulating) Linux environment - without Smartphone rooting needed !!! Convenience is being paid by very small one time amounts (below 10€ in total).

https://termux.com/

Only some very few and special commands are missing. On the other hand hacking tools like netcat and socat are available ... :oops:

Regards

wifi
Last edited by WiFi on Thu May 28, 2020 1:44 am, edited 1 time in total.

wpballa1
Posts: 70
Joined: Sat Jun 27, 2015 12:49 am

Re: How to connect (throught SSH) to the Pi throught mobile phone

Wed May 27, 2020 10:12 pm

I use WebSSH but only on my local LAN. It is loaded on my phone (and iPad) and I connect through the house LAN WiFi. Editing is no problem as it does have a control key emulated. A relatively inexpensive app.

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

Re: How to connect (throught SSH) to the Pi throught mobile phone

Wed May 27, 2020 10:33 pm

I use https://play.google.com/store/apps/deta ... i.juicessh. It's so good I've paid for the "pro" version.

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

Criticising any questions is banned on this forum.

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

RenThraysk
Posts: 1
Joined: Thu May 28, 2020 11:52 am

Re: How to connect (throught SSH) to the Pi throught mobile phone

Thu May 28, 2020 12:48 pm

Take a look at tailscale, if want secure access to the Pi remotely.

https://tailscale.com

https://tailscale.com/kb/1025/install-rpi

WiFi
Posts: 31
Joined: Sat Oct 19, 2013 6:01 pm

Re: How to connect (throught SSH) to the Pi throught mobile phone

Thu May 28, 2020 1:14 pm

RenThraysk wrote:
Thu May 28, 2020 12:48 pm
Take a look at tailscale, if want secure access to the Pi remotely.

https://tailscale.com

https://tailscale.com/kb/1025/install-rpi
Quotation from Tailscale: ".. Tailscale public keys and metadata are shared through a centralized coordination server. ..."

Will mean (similar to a Third Party VPN Service) you have a Third Party involved (although traffic goes peer to peer after authorization).

I prefer solutions without any Third Party involvement for connection set ups and traffic transport.

Regards

ag123
Posts: 108
Joined: Sun Dec 18, 2016 7:54 am

Re: How to connect (throught SSH) to the Pi throught mobile phone

Thu May 28, 2020 1:43 pm

i think one of the simpler ways is to run something like a mqtt server that funnel data between the remote device (sensor) and Pi.
but these days there seemed to be many alternatives than simply mqtt

ancris00
Posts: 52
Joined: Sun Jan 19, 2020 8:56 pm
Location: Miranda de Ebro, Spain

Re: How to connect (throught SSH) to the Pi throught mobile phone

Thu May 28, 2020 8:53 pm

Hi dickon, frutioftheloom, scottyanke, wifi, wpballa1, DougieLawson, RenThraysk, ag123, thanks all

*just to remark. I don´t know if some of you get the point. I want to control my raspberry that is far away from home (>100kilometers)

dickon: -my mobile phone has the following public-ip 47.x.x.x
-my Raspberry 192.x.x.x
-my laptop 188.x.x.x

fruitoftheloom: I did already a vnc connection but it is high bytes consumtion

scottyanke: as I said before, my raspberry is far away from my home. Bluetooth is only for a couple of meters

wifi: I will try Termus

wpballa1: you speak about Webssh but you said that is for your LAN. I do not have LAN. my raspberry is far away from my home

DougieLawson: do juicessh (installed in my far away mobile phone) work as a router rerouting my external conexion (from home) to my raspberry?

RenThraysk: tailscale cancell as uses 3rd parties

ag123: it is not a question about sensors and raspberry. I want to control my raspberry that is far away from home (>100kilometers).

thanks again all for your time

I will wait DougieLawson for your answer
:lol: :lol: Pi 4 Model B :lol: :lol:
Raspbian Buster with desktop 4.19

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

Re: How to connect (throught SSH) to the Pi throught mobile phone

Thu May 28, 2020 9:02 pm

If you want to control from a distance login to RealVNC and use their cloud service. There's a RealVNC client for your phone.

https://www.realvnc.com/en/news/what-vnc-cloud/
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

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

ancris00
Posts: 52
Joined: Sun Jan 19, 2020 8:56 pm
Location: Miranda de Ebro, Spain

Re: How to connect (throught SSH) to the Pi throught mobile phone

Fri May 29, 2020 2:34 pm

Hi DouguiLawson, thanks :D

I do not want to use VNC as is high gigabytes consumer. It drains my internet plan on my "far away mobile phone". The plan is just 100mb

For this reason I want to control my "far away Raspberry" with SSH

So please, do juicessh (installed in my far away mobile phone) work as a router rerouting my external conexion (from home) to my raspberry?
:lol: :lol: Pi 4 Model B :lol: :lol:
Raspbian Buster with desktop 4.19

User avatar
dickon
Posts: 1452
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: How to connect (throught SSH) to the Pi throught mobile phone

Fri May 29, 2020 2:52 pm

No, but there's a useful Android app called 'SSHelper', which installs an sshd (and rsync binaries) on an unrooted phone which you could probably use to port-forward to the Pi. I use it to keep my phone backed up, but the ssh binary it installed seems to support the port-forwarding options.

Whether it's a: possible to make any inbound connection to the phone over the mobile network from arbitrary hosts on the Internet, and if b: running a service like that 24/7 is a good idea, are things you'll need to consider.

Return to “Advanced users”