Last active
March 5, 2021 20:08
-
-
Save bittner/85466c120e7cbe94f4a4 to your computer and use it in GitHub Desktop.
How can I access my Ubuntu phone over ssh? (no `adb shell` required)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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