Skip to content

Instantly share code, notes, and snippets.

@bittner
Last active Mar 5, 2021
Embed
What would you like to do?
How can I access my Ubuntu phone over ssh? (no `adb shell` required)
#!/bin/bash
# GNU GPL v3 license, (c) 2016 by Alexander Kinne, Peter Bittner
# http://askubuntu.com/questions/601910/ssh-ubuntu-touch/653595#653595
IP_ADDRESS=$(ip addr show primary | grep wlan | grep 'inet ' | sed -e 's/^\s*inet //' -e 's/ brd .*$//' -e 's#/.*##')
echo "Your IP address: $IP_ADDRESS (wlan)"
if [[ "$(android-gadget-service status ssh)" == "ssh enabled" ]]; then
sudo android-gadget-service disable ssh
else
sudo android-gadget-service enable ssh
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment