Создать юзера и поставить ему пароль:
Добавить новосозданного юзера в группы:
Создать новую группу:
Поставить основную группу новосозданному юзеру:
Добавить существующего юзера в группу:
Установить существующему юзеру основную группу:
# adduser tom # passwd tom
Добавить новосозданного юзера в группы:
# useradd -G admins,ftp,www,developers jerry
Создать новую группу:
# groupadd developers
Поставить основную группу новосозданному юзеру:
# useradd -g developers tonyА теперь посмотрим где он и что он
# id tony
Добавить существующего юзера в группу:
usermod -a -G ftp tony
Установить существующему юзеру основную группу:
# usermod -g www tony
adduser command options summary
- -c comment: Add a comment for the user
- -d home-directory: Create a new home-directory
- -e yyyy-mm-dd: Date for the account to be disabled
- -f days: Number of days after the password expires until the account is disabled. (If 0 is specified, the account is disabled immediately after the password expires. If -1 is specified, the account is not be disabled after the password expires.)
- -g group-name: Primary Group name or group number for the user's default group (group name must exist)
- -G group-list: List of secondary additional (other than default) group names or group numbers, separated by commas, of which the user is a member (group name must exist)
- -m: Create the home directory
- -M: Do not create the home directory
- -s: User's login shell (default /bin/bash)
usermod command options summary
| Option | Purpose |
|---|---|
| -a --append | Add the user to the supplementary group(s). Use only with the -Goption. |
| -g GROUP --gid GROUP | Use this GROUP as the default group. |
| -G GRP1,GRP2 --groups GRP1,GRP2 |
Комментариев нет:
Отправить комментарий