I have my raspberry pi installed with ArchLinux Arm. I enabled UART and connected TTL pins with my PC via a USB2TTL adapter. This setup works fine as I can log in to the default alarm user --- a user in the wheel group --- and use systemctl start/stop without sudo. However, I got the following errors when I was attempting to connect to WiFi with nmcli device connect:

Error: Device 'wlan0' (/org/freedesktop/NetworkManager/Devices/3) disconnecting failed: org.freedesktop.NetworkManager.network-control request failed: not authorized
Error: not all devices disconnected.

Initially, I doubt there might be something wrong with polkit, so I compared the checksums of actions and rules between the raspberry pi and my PC --- which runs ArchLinux --- and surprisingly all files are identical. After some researches, I found out that this phenomenon also emerges in ssh sessions. I also found something mentioned in other stack exchange answers:

By default, DBus only allows root and users sitting at the physical console to control networking settings.

Yes, this makes sense if there are additional authorizations required if a network-based session wants to change network settings. However, UART has nothing to do with the network. It is a serial port. I personally believe it should fall to the case of a physical console.

I then tested connecting my raspberry pi with a monitor and a keyboard for the command above. There's no error this time, and the change succeeds. Obviously, the UART based session is not considered as a physical console, which is quite astonishing. Nevertheless, I do want to enable the UART session to control network without sudo, while keeping this feature for network-based sessions like ssh. Any ideas for achieving that?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.