Remove user from wheel who was added during install FreeBSD.

Hello.

I can't find solutions, how can I remove a user from /etc/group who I added during installing FreeBSD? It shows me that I'm in the wheel group but I don't see it in /etc/group. How can I find and remove this user from wheel? Google says not too much.

Greet.
 
Can't I remove only that user from this group? Is it necessary to make a new group and change GID?
 
Yes you can. One way of doing it is by editing the /etc/group file and removing the user from the group you want.
Another way is by using: [CMD=""]pw usermod <username> -g <group_name>[/CMD]

PS: I hope we're not talking about the root user here :)
 
Heh. Not talking about root. I do not even mean it mate. The first way is impossible, because when you choose your user during the installation of FreeBSD you will not see him in /etc/group. So that's why I will try to use the second way. Thanks for help.
 
I mean that if you write to wheel group user after installation of FreeBSD you will see him in /etc/group (wheel:user,user1,user2 etc...) But during installation it will ask do you want to add a new user or group. After this options when you want to see /etc/group for wheel user you will see nothing. Only empty wheel: But checking my id I'm in the wheel group. Why?
 
There are two sets of groups: Primary Groups, and Secondary Groups.

Primary Group IDs are set in /etc/passwd. The format for passwd entries is:
Code:
cups:*:193:[b]193[/b]:CUPS Owner:/nonexistent:/usr/sbin/nologin
username:password:user ID:[b]primary group ID[/b]:long name:home directory:shell

When you add a user to the end of the line in /etc/group, that's adding a Secondary Group ID to the user.

No idea how you have managed to set the Primary Group ID of a user to 0. I've never seen that happen, and every single one of my FreeBSD installs includes my user as part of groups "fcash", "wheel", and "operator". And wheel/operator is set as secondary group automatically.

When you use commands like id() or groups() you get the combination of Primary Group and all Secondary Groups.
 
Back
Top