Howto manage user and groups: Difference between revisions
Jump to navigation
Jump to search
(Created page with "= creating users = add user and create home folder: useradd -m student specify shell when creating the user: useradd -m -s /bin/bash student specify another location for use...") |
|||
Line 2: | Line 2: | ||
add user and create home folder: | add user and create home folder: | ||
useradd -m student | useradd -m student | ||
specify shell when creating the user: | specify user shell when creating the user: | ||
useradd -m -s /bin/bash student | useradd -m -s /bin/bash student | ||
specify another location for user home folder: | specify another location for user home folder: | ||
useradd -m -d /opt/student student | useradd -m -d /opt/student student | ||
specify default group name: | specify default group name or group id: | ||
useradd -m -g student | useradd -m -g student | ||
specify userid: | specify userid: | ||
useradd -m -u 1000 student | useradd -m -u 1000 student | ||
create user and this user to different groups: | create user and add this user to different groups: | ||
useradd -m -g student -G video,docker,sound,lp student | useradd -m -g student -G video,docker,sound,lp student | ||
assign password to user: | assign password to user: | ||
passwd student | passwd student | ||
= manage groups = | = manage groups = | ||
add group: | add group: |
Revision as of 21:31, 3 September 2021
creating users
add user and create home folder:
useradd -m student
specify user shell when creating the user:
useradd -m -s /bin/bash student
specify another location for user home folder:
useradd -m -d /opt/student student
specify default group name or group id:
useradd -m -g student
specify userid:
useradd -m -u 1000 student
create user and add this user to different groups:
useradd -m -g student -G video,docker,sound,lp student
assign password to user:
passwd student
manage groups
add group:
groupadd vidalinux
add user to group:
gpasswd -a student vidalinux
add user to more than one group:
usermod -G wheel,video,sound,lp student
to list all groups on our system:
less /etc/group