I want to SSH my new Ubuntu phone and tried this instruction but it doesn't work. I get
"error: device not found" from every single command.
Actually, the only thing you need to do to access your Ubuntu Touch device via SSH is place an
authorized_keys file (with a public key of the PC you're using to access the Ubuntu Touch device) in
/home/phablet/.ssh/, and enable SSH access via
sudo android-gadget-service enable ssh in the Terminal app.
See this answer for an elegant way to get your ssh keys on the device (ignoring the outdated
Once this is done, you may want to have a way to toggle the SSH server state for extra security while roaming in foreign networks:
- SSH into your device:
- Create a folder for your scripts:
- Fire up nano to create a script:
Paste the following:
#!/bin/bash if [[ "$(android-gadget-service status ssh)" == "ssh enabled" ]]; then sudo android-gadget-service disable ssh else sudo android-gadget-service enable ssh fi
Save the script and exit nano.
Make the script executable:
chmod +x /home/phablet/bin/toggle-ssh.sh
Now you can easily turn your SSH Server on or off by running:
/home/phablet/bin is in the path for your users executables.
Note: If you face permission issues of
bash when executing the script from the device terminal app you need to run:
I also faced this issue and resolved it with the help of this post: Tether Ubuntu bq phone
If the adb command above fails, it might be because the vendor of the phone is unkown (it was for me in 14.04). In that case find it with
lsusb *Bus 001 Device 010: ID 2a47:0c02*
Now add 0x2a47 to
Then restart the adb server after you edited the file with:
sudo adb kill-server; sudo adb start-server
Hope that helps, cheers Andreas
Thank you for your information, I finally manage to connect to my phone true SSH.
That's how I did:
- Install WifiTransfert from the app store;
- Copy your ssh public key to the phone;
add your public key to authorized_key:
cat .local/share/wifitransfer.sil/id_rsa.pub > ~/.ssh/authorized_key
Start ssh service:
From there, you can ssh your phone. sudo ifconfig to get the IP address.