Welcome to the Linux Foundation Forum!

Usermod.

Hi.

Can you explain this line for me please.

$ sudo usermod -G student,group1,group2 student

Comments

  • luisviveropena
    luisviveropena Posts: 1,249

    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.

Categories

Upcoming Training