Snapd users API on ubuntu classic

Hi,

Does anyone know if modifying users on Ubuntu Classic is not support or not ?

It seems not from the initial attempt, as I got the following response:

405 Client Error: Method Not Allowed for url: http://snapd/v2/users

Just looking for confirmation, and/or any reasoning.

Thanks!

Cheers, Just

The denial is coming from this code:

Snapd only manages user accounts on Ubuntu Core systems. Elsewhere, it’s assumed to be controlled by the host system.

That’s a shame, but thanks for confirming @jamesh :+1:

We have a snap that manages users on our UC systems, using assertions and the snapd API, and it would be nice if it just worked on Classic as well.

Cheers, Just

On Ubuntu Core, we know exactly how user accounts are managed.

On a classic system, it could be any number of ways due to PAM and NSS. In some configurations, there might not be any way to locally create new user accounts (e.g. if they’re all being managed in a remote LDAP directory that you don’t have administrative access to). So in addition to it being out of scope on classic, there’s enough edge cases to make it hard to implement reliably.

If you’re just working with desktop distributions with default user management, they have accounts-daemon available, which you should be able to access via the accounts-control interface. This is the same API that the users panel in gnome-control-center uses.

I agree, there is more to consider.

However, on a host which is managed and all configuration is known and deliberate, it could/should still be a choice, just like any of the other account configuration options you mention. It could be off by default, and enabled by some snapd system config.

I appreciate there are other ways from a snap, but it still means maintaining multiple separate approaches.

Cheers, Just