opened
itoffshore
username_0
<!--
Github issues are used for bug reports. For support questions, please use [our forum](https://discuss.linuxcontainers.org).

Please fill the template below as it will greatly help us track down your issue and reproduce it on our side.  
Feel free to remove anything which doesn't apply to you and add more information where it makes sense.
-->

# Required information

 * Distribution: `Ubuntu` 
 * Distribution version: `18.04`
 * LXD via `snapd`
 * Storage backend in use: zfs

# Feature description

referring to the `both` option in [https://github.com/lxc/lxd/blob/master/doc/userns-idmap.md](https://github.com/lxc/lxd/blob/master/doc/userns-idmap.md)

Not every `$USER` has the same Primary Group `id` as their `$USER id` on a network using `ldap`. It would be useful to be able to map a `uid` & a different `gid` when setting values for `raw.idmap`

As an example - an extra option for "`usergroup`":

`lxc config set c1 raw.idmap "usergroup 10000 10400"`

which would map `uid 10000` & `gid 10400` to be the same both inside & outside the container
Custom idmaps - map different uid / gid
issue
created
stgraber
username_1
You can absolutely do that, the doc says it's multi-line. Just put a `uid` line and a `gid` line instead of using `both`.
comment
closed
stgraber
username_1
issue
created
itoffshore
username_0
many thanks for the quick answer - here is an example for others:

```
lxc config set c1 raw.idmap "uid 10000 10000
gid 100000-110000 10000-20000"
```
comment