Local Users

  • Canonical BootStack Charmers
Channel Revision Published Runs on
latest/stable 27 07 Jun 2024
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/stable 18 28 Apr 2023
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/candidate 27 06 May 2024
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/candidate 18 06 Apr 2023
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/edge 68 11 Dec 2024
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/edge 67 11 Dec 2024
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/edge 64 08 Nov 2024
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/edge 62 08 Nov 2024
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/edge 61 08 Nov 2024
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/edge 59 08 Nov 2024
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/edge 19 03 May 2023
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
latest/edge 6 14 Mar 2022
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04
juju deploy local-users
Show information

Platform:

Ubuntu
22.04 20.04 18.04

Tutorial: Get started

Here’s how to get started with using the charm-local-users application.

Firstly, create a configuration file as shown below:


$ cat config-local-users.yaml
local-users:
  group: mygroup
  users: |
    alice;Alice;ssh-rsa ABC alice@desktop
    bob;Bob;ssh-rsa XYZ bob@laptop

Deploy any principal charm application of your choice, e.g. Ubuntu

juju deploy ubuntu

Deploy the charm-local-users application providing the path to the configuration file you created earlier:

juju deploy --config config-local-users.yaml local-users

Relate to the principal charm application.

juju relate local-users ubuntu

The charm can also be configured after deployment.

For example, to remove bob’s account, create an updated user list file user.lst that doesn’t include Bob’s account anymore and simply update the config:

$ cat user.lst
alice;Alice;ssh-rsa ABC alice@desktop

Now provide this config to the charm.

juju config local-users users=@user.lst

The charm will enter a blocked state if you try to add a user account that already exists but isn’t a member of the managed group. If you’re sure that you want to add the pre-existing account to the managed group anyway, making it a charm managed account from now, you can run:

juju config local-users allow-existing-users=true

Home directories of removed users will be backed up in the location specified in the backup-path config option before being removed.


Help improve this document in the forum (guidelines). Last updated 8 months ago.