Added KB about ubports

This commit is contained in:
Michele Cereda
2023-02-25 18:45:06 +01:00
parent 62b9faa684
commit 20f991324f

69
knowledge base/ubports.md Normal file
View File

@@ -0,0 +1,69 @@
# ubports
1. [TL;DR](#tldr)
1. [Connect using SSH](#connect-using-ssh)
1. [Sources](#sources)
## TL;DR
```sh
# List containers.
libertine-container-manager list
# Create containers.
# Default type: 'chroot'.
libertine-container-manager create -i 'identifier'
libertine-container-manager create -i 'identifier' -n 'name' -t 'lxc'
# Destroy containers.
libertine-container-manager destroy -i 'identifier'
```
## Connect using SSH
> SSH is configured to allow only public key-based access.
1. Open the terminal application.
1. Download, receive or otherwise write the public key on your device:
```sh
wget 'https://some.reachable.url/key.pub'
```
1. Copy the key to the `authorized_keys` file; start from the following commands:
```sh
mkdir "${HOME}/.ssh"
chmod 700 "${HOME}/.ssh"
cat "${HOME}/key.pub" >> "${HOME}/.ssh/authorized_keys"
chmod 600 "${HOME}/.ssh/authorized_keys"
```
1. Start SSH:
```sh
# On Android-based devices (like the OnePlus One).
sudo android-gadget-service enable ssh
# On Linux-based devices (like the PinePhone).
sudo service ssh start
```
1. Optionally, find the device's IP address:
```sh
hostname -I
```
1. Finally, connect from a device using the private key and the `phablet` user:
```sh
ssh -i 'path/to/private.key' 'phablet@ubuntu-phablet.lan'
```
## Sources
- [Documentation]
<!-- project's references -->
[documentation]: https://docs.ubports.com/en/latest/index.html