Welcome to the Linux Foundation Forum!

Usermod.

Hi.

Can you explain this line for me please.

$ sudo usermod -G student,group1,group2 student

Comments

  • Posts: 1,274

    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.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training