# PW -G does not work



## dalpets (Oct 20, 2022)

`pw usermod  -G` does not add my current user to the video group when I afterrun the user ID


----------



## VladiBG (Oct 20, 2022)

Chapter 3. FreeBSD Basics
					

Basic commands and functionality of the FreeBSD operating system




					docs.freebsd.org


----------



## dalpets (Oct 20, 2022)

VladiBG said:


> Chapter 3. FreeBSD Basics
> 
> 
> Basic commands and functionality of the FreeBSD operating system
> ...


Been there!
 /etc/groups (@ root) "permission denied"


----------



## Emrion (Oct 20, 2022)

You must be root. You'd better use: `pw groupmod video -m user`.
If you're root what is the output of `ls -l /etc/group` (and not groups)?


----------



## dalpets (Oct 20, 2022)

-rw-r--r-- /etc/group


----------



## Emrion (Oct 20, 2022)

This is not the real output of `ls -l /etc/group`. Should be something like:

```
ls -l /etc/group
-rw-r--r--  1 root  wheel  623 31 oct.   2021 /etc/group
```
If you want some help, try to be more precise. Show the exact command and the exact output each time and especially for the error you get.


----------



## SirDice (Oct 20, 2022)

dalpets said:


> `pw usermod -G` does not add my current user to the video group when I afterrun the user ID


You're using it wrong.


```
-G grouplist  Set secondary group memberships for an account.  grouplist
                   is a comma, space, or tab-separated list of group names or
                   group numbers.  The user is added to the groups specified
                   in grouplist, and removed from all groups not specified.
                   The current login session is not affected by group
                   membership changes, which only take effect when the user
                   reconnects.  Note: do not add a user to their primary group
                   with grouplist.
```

If you want to _add_ your user to the video group use `pw groupmod video -m <user>`


```
-m newmembers  Similar to -M, this option allows the addition of existing
                    users to a group without replacing the existing list of
                    members.  Login names or user ids may be used, and
                    duplicate users are silently eliminated.
```


----------



## dalpets (Oct 22, 2022)

Emrion said:


> This is not the real output of `ls -l /etc/group`. Should be something like:
> 
> ```
> ls -l /etc/group
> ...


That's  not possible when stuck at the startup command line of a new system!
BTW: you didn't bother to answer the question!


----------



## Emrion (Oct 22, 2022)

dalpets said:


> That's  not possible when stuck at the startup command line of a new system!
> BTW: you didn't bother to answer the question!


For sure, we don't have the same FreeBSD base system...
Maybe someone else will *bother* to help you.


----------



## dalpets (Oct 22, 2022)

Emrion said:


> For sure, we don't have the same FreeBSD base system...
> Maybe someone else will *bother* to help you.


I have *bothered* to work it out for myself!
Try to have a good day


----------

