Source for: https://cirosantilli.com and https://ourbigbook.com/cirosantilli Build HTML with https://github.com/ourbigbook/ourbigbook with "npm install && npx ourbigbook ." You can use this issue tracker for anything you want to tell me, even if it is not related to the repo. I also use this repo as generic issue tracker for myself.
SSHDroid App is a possibility, and there are many others available from Google Play (search for SSHD).
Get your Android and PC on the same LAN.
Open SSHDroid
Note the "Address" field shown on the app. It should look something
like root@192.168.0.3:2222.
You could also use netcfg + adb to get the device IP from the
CLI.
Install an SSH client on your PC, e.g.:
sudo apt-get install openssh-client
on Ubuntu 15.10
Run on your PC:
ssh root@192.168.0.3 -p 2222
It says:
Default password is 'admin'
root@192.168.0.3's password:
So type admin and enter.
We're in. Try ls. But note that:
many folders are not accessible without rooting your device. In
particular, each app has it's own Linux user, and you are logged
in as the SSHDroid user.
an Android device is not a POSIX system, and in particular POSIX
CLI utilities may be missing, e.g. cal (how could you live
without that?)
The SSH server continues running on Android as a daemon even if the
SSHDroid window is closed. To stop it you must go on the app and click
STOP.
I have also tried SSH Server from Ice Cold Apps. It is definitely more powerful, allowing multiple connections and other protocols, but it required a bit more setup.
Tested on Ubuntu 15.10, Android 5.1.1. SSHDroid 2.1.2.
adb shell USB
If you just want to quickly get a shell on your USB connected device to help development, install the SDK, enable debugging and do:
adb shell
it's the simpler way.
I only came here because I had never done Android development before and thought: need a shell on another computer... SSH! But sometimes mobile is different.
For file transfers, you want adb pull and adb push.
adb shell TCP
If you don't have USB access to the device, you can also connect adb shell over TCP, which provides a solution very similar to ssh.
https://stackoverflow.com/questions/11468053/how-can-i-communicate-with-an-android-device-via-ssh/34040560#34040560
SSH server apps
SSHDroid App is a possibility, and there are many others available from Google Play (search for
SSHD
).Get your Android and PC on the same LAN.
Open SSHDroid
Note the "Address" field shown on the app. It should look something like
root@192.168.0.3:2222
.You could also use
netcfg
+adb
to get the device IP from the CLI.Install an SSH client on your PC, e.g.:
on Ubuntu 15.10
Run on your PC:
It says:
So type
admin
and enter.We're in. Try
ls
. But note that:many folders are not accessible without rooting your device. In particular, each app has it's own Linux user, and you are logged in as the SSHDroid user.
an Android device is not a POSIX system, and in particular POSIX CLI utilities may be missing, e.g.
cal
(how could you live without that?)The SSH server continues running on Android as a daemon even if the SSHDroid window is closed. To stop it you must go on the app and click
STOP
.I have also tried SSH Server from Ice Cold Apps. It is definitely more powerful, allowing multiple connections and other protocols, but it required a bit more setup.
Tested on Ubuntu 15.10, Android 5.1.1. SSHDroid 2.1.2.
adb shell USB
If you just want to quickly get a shell on your USB connected device to help development, install the SDK, enable debugging and do:
it's the simpler way.
I only came here because I had never done Android development before and thought: need a shell on another computer... SSH! But sometimes mobile is different.
For file transfers, you want
adb pull
andadb push
.adb shell TCP
If you don't have USB access to the device, you can also connect adb shell over TCP, which provides a solution very similar to ssh.
More details: https://stackoverflow.com/questions/2604727/how-can-i-connect-to-android-with-adb-over-tcp