10-02-2020, 08:17 AM
I don't think I did anything special to get the USB networking going on Mobian - I installed to emmc via jumpdrive some time back and have applied upgrades via apt since then. It's using the configfs based gadget configuration:
https://www.kernel.org/doc/html/v5.8/usb...figfs.html
The config appears under /sys/kernel/config/usb_gadget/g1/ while the network device is usb0 on the pinephone, visible in nmcli. When plugged into my Ubuntu desktop the pinephone shows this in dmesg:
IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready
For openssh I manually installed openssh-server via apt in the terminal while connected to wifi. I usually ssh into the wifi address too. Since the password is necessarily fairly weak on the phone due to the lock screen you really ought to disable password access and use keys see the wiki entry if you don't already know how:
https://wiki.mobian-project.org/doku.php?id=security
For PmOS if you use pmbootstrap I think it'll ask you about using ssh and setting up to use your key. It's a while since I've tried that, but I think the USB networking worked out of the box with that too, at least with an ubuntu desktop.
One thought about the USB networking - it's usually set up with the phone providing dhcp for the PC, with the expectation that it'll be used for tethering. This means that the routing isn't set up to allow the phone to access the internet via your PC and its network connection. If you want to use it that way round it's possible, but it'll probably need some manual configuration. It's usually easier to use wifi.
https://www.kernel.org/doc/html/v5.8/usb...figfs.html
The config appears under /sys/kernel/config/usb_gadget/g1/ while the network device is usb0 on the pinephone, visible in nmcli. When plugged into my Ubuntu desktop the pinephone shows this in dmesg:
IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready
For openssh I manually installed openssh-server via apt in the terminal while connected to wifi. I usually ssh into the wifi address too. Since the password is necessarily fairly weak on the phone due to the lock screen you really ought to disable password access and use keys see the wiki entry if you don't already know how:
https://wiki.mobian-project.org/doku.php?id=security
For PmOS if you use pmbootstrap I think it'll ask you about using ssh and setting up to use your key. It's a while since I've tried that, but I think the USB networking worked out of the box with that too, at least with an ubuntu desktop.
One thought about the USB networking - it's usually set up with the phone providing dhcp for the PC, with the expectation that it'll be used for tethering. This means that the routing isn't set up to allow the phone to access the internet via your PC and its network connection. If you want to use it that way round it's possible, but it'll probably need some manual configuration. It's usually easier to use wifi.