Dodaj użytkownika do grupy
usermod -a -G examplegroup exampleusername
Black Beaver
usermod -a -G examplegroup exampleusername
sudo usermod -aG <groups> <username>
from django.contrib.auth.models import User, Group
from django.db.models.signals import post_save
from django.dispatch import receiver
@receiver(post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
instance.groups.add(Group.objects.get(name='group_name'))
useradd -g <group> <user>
$ useradd -g developer tom
usermod -a -G <group> <user>
$ usermod -a -G developer tom
sudo usermod -a -G GROUP USER