By Kevin


2019-07-08 03:55:21 8 Comments

I am using Wi-Fi hotspot on Android. Can I SSH into it from my laptop which is connected to hotspot? How would I do this?

1 comments

@Irfan Latif 2019-07-08 07:15:37

You need to run an SSH server on your Android phone. There are apps available, but simple solution is to go for Termux. Install app, then install packages openshh and termux-auth. Set password and start server:

~$ pkg install openssh termux-auth
~$ passwd
~$ sshd

If you want to use key authentication instead of password, create key pair on client with ssh-keygen and copy the contents of ~/.ssh/id_rsa.pub to phone in ~/.ssh/authorized_keys (where Termux's $HOME is /data/data/com.termux/files/home), and restart server:

~$ pkill sshd
~$ sshd

Now on client:

~$ ssh <Phone_IP> -p 8022

No username is required as Termux is the only user which can be logged into. If you want default port (22) or a username or multiple user setup, visit the link given below.

RELATED:

@Kevin 2019-07-09 00:46:54

Thank you. I did not realize termux was different from terminal emulator. Im curious, does it have its own applications etc? Like its own sh etc?

@Irfan Latif 2019-07-09 02:29:07

@Kevin yes it doesn't run Android's /system/bin/sh by default, instead its own package bash, modified for Android environment.

Related Questions

Sponsored Content

1 Answered Questions

[SOLVED] How to connect two phones via SSH with a central SSH server?

2 Answered Questions

[SOLVED] SSH tunnel with two hops

  • 2013-11-18 01:32:17
  • cshelton
  • 1669 View
  • 3 Score
  • 2 Answer
  • Tags:   ssh

1 Answered Questions

2 Answered Questions

1 Answered Questions

[SOLVED] How to ssh into an unrooted Android device using sshdroid from a Linux computer

  • 2015-08-09 12:04:09
  • user121392
  • 14024 View
  • 4 Score
  • 1 Answer
  • Tags:   ssh

1 Answered Questions

[SOLVED] Can't seem to SSH from Android

  • 2016-04-05 04:41:11
  • PairedPrototype
  • 1599 View
  • 1 Score
  • 1 Answer
  • Tags:   ssh

2 Answered Questions

[SOLVED] How to start SSH Server in my Android?

  • 2011-11-10 22:51:56
  • YumYumYum
  • 43091 View
  • 13 Score
  • 2 Answer
  • Tags:   ssh

Sponsored Content