Just joined after watching some of the live streams from the UBPorts team on YouTube. Installed UBPorts on my Pinetab and loving it so far!
Best posts made by Event Horizon
-
RE: Welcome to the UBports community! Introduce yourself here!
-
How to enable SSH on Pinetab 2
The Pinetab devices don't support ADB (at least, not to my knowledge), so SSH must be used instead. I had to use a couple of workarounds to get SSH access working, so I wanted to share the process here for anyone else who may need to get SSH support enabled.
Firstly, you'll need to copy a public key from your computer (the device you will be connecting from). If you don't have one, you will need to run "ssh-keygen" in your computer's terminal. When prompted, type in a name for the key (or just use the default "id_rsa" name if you wish), then go into ~/.ssh and copy the .pub file (it will be called id_rsa.pub if you've used the default names in ssh-keygen).
Next, we will need to get our newly created .pub public key onto the Pinetab, which will require a flash drive. I had some difficulties using the built in file browser to copy/paste, so I had to use the terminal to do this. Open a terminal on your pinetab, and run:
Copy SSH key from flash drive:
- cd /media
- ls /media
- cd [name of the flash drive you've plugged in]
- mkdir ~/.ssh
- cp id_rsa.pub ~/.ssh/id_rsa.pub
Set correct permissions for SSH key and folder:
- chmod -R 700 ~/.ssh
- chmod 644 ~/.ssh/id_rsa.pub
- chown -R phablet:phablet /home/phablet/.ssh
Optional: Add to authorized keys (prevents password prompts upon login)
- cd ~/.ssh
- touch authorized_keys
- chmod go-w ~/.ssh ~/.ssh/authorized_keys
- cat id_rsa > authorized_keys
(This step is optional, but is recommended if you intend on connecting to your Pine64 device for Clickable projects.)
Finishing up:
Now that we have the SSH key copied and have set the correct permissions, we are almost ready to start the SSH service on the pinetab. However, we must employ one more workaround to create host keys. Otherwise, we will see a "ssh.serviceJob for ssh.service failed because the control process exited with error code."
Create host keys:
- sudo ssh-keygen -A
- sudo service ssh --full-restart
- sudo service ssh start
- systemctl status ssh.service (verify that it's running. If this fails, restart the device and try again)
Lastly, we must get the IP address on our Pinetab so that we can use this to connect:
- hostname -I
(This will spit out several values, each separated by a space. We're only concerned with the first one, which is the iP address of our Pinetab on the network).
Now, we can head over to our computer and connect. Run:
- ssh phablet@IP_ADDRESS_OF_PINETAB
This should be all that you need to get connected to your Pinetab 2 via SSH!