Skip to main content
edited title
Link
Giacomo1968
  • 56.1k
  • 23
  • 167
  • 214

Linux - Switch How to switch user to subuid running LXC container?

edited title
Link
Xylem
  • 11
  • 3

LXC Linux - Switch user to subuid running LXC container

added 155 characters in body
Source Link
Xylem
  • 11
  • 3

I'd like to either use su or sudo -u to switch users to the subuid created by LXC to run a container as unprivileged.

Note:

  • There is no username assigned to the UIDs in which containers are run.
  • Due to the above, I need to be able to switch purely by UID.

I've tried doing as this post instructed, but I get the following:

[user@laptop user]# sudo -u \#100000 id
sudo: unknown user #100000

If It's somehow helpful:

  • I'm using Arch Linux
  • I'm using LXD to manage to container(s)

Does anyone know if there is a way to do this, even if via another command or method?

I'd like to either use su or sudo -u to switch users to the subuid created by LXC to run a container as unprivileged.

I've tried doing as this post instructed, but I get the following:

[user@laptop user]# sudo -u \#100000 id
sudo: unknown user #100000

If It's somehow helpful:

  • I'm using Arch Linux
  • I'm using LXD to manage to container(s)

Does anyone know if there is a way to do this, even if via another command or method?

I'd like to either use su or sudo -u to switch users to the subuid created by LXC to run a container as unprivileged.

Note:

  • There is no username assigned to the UIDs in which containers are run.
  • Due to the above, I need to be able to switch purely by UID.

I've tried doing as this post instructed, but I get the following:

[user@laptop user]# sudo -u \#100000 id
sudo: unknown user #100000

If It's somehow helpful:

  • I'm using Arch Linux
  • I'm using LXD to manage to container(s)

Does anyone know if there is a way to do this, even if via another command or method?

Source Link
Xylem
  • 11
  • 3
Loading