Welcome to the new Linux Foundation Forum!

Usermod.

Hi.

Can you explain this line for me please.

$ sudo usermod -G student,group1,group2 student

Comments

  • luisviveropenaluisviveropena Posts: 391

    Hi @WarrenUK ,

    From man usermod(8):

    NAME
    usermod - modify a user account

    SYNOPSIS
    usermod [options] LOGIN

    [...]

    OPTIONS

    -G, --groups GROUP1[,GROUP2,...[,GROUPN]]]
    A list of supplementary groups which the user is also a member of. Each group is separated from the next by a comma, with no intervening whitespace.
    The groups are subject to the same restrictions as the group given with the -g option.

    [...]

    So, the command basically adds the user to groups in the system.

    I hope that helps,
    Luis.

Sign In or Register to comment.