usermod говорит, что учетная запись не существует, но adduser говорит, что делает

Я выполняю команду

usermod -a -G dialout amashreghi

но я добираюсь, amashreghi не делает существует, однако, когда я пытаюсь добавить пользователя, использующего adduser

adduser amashreghi

Это говорит, что amashreghi уже существует. Что продолжается?!

2
задан 11 October 2017 в 23:14

4 ответа

Дайте этому попытку. (Я предполагаю, что Вы готовы удалить все связанное с этим пользователем и запуститься, не выполняйте их, если Вы не.)

userdel -r amashreghi
grep amashreghi /etc/passwd

, Если та вторая команда возвращает что-нибудь, выполненное:

sudo -H gedit /etc/passwd

Удаляют строку, которая начинается amashreghi, и сохраните файл. Попытайтесь добавить пользователя снова теперь.

0
ответ дан 2 December 2019 в 08:31

Отредактировать /etc/group непосредственно используйте vigr

От man vigr

NAME
       vipw, vigr - edit the password, group, shadow-password or shadow-group file

SYNOPSIS
       vipw [options]

       vigr [options]

DESCRIPTION
       The vipw and vigr commands edits the files /etc/passwd and /etc/group, respectively. With the -s flag,
       they will edit the shadow versions of those files, /etc/shadow and /etc/gshadow, respectively. The
       programs will set the appropriate locks to prevent file corruption. When looking for an editor, the
       programs will first try the environment variable $VISUAL, then the environment variable $EDITOR, and
       finally the default editor, vi(1).

Следовательно, можно отредактировать /etc/group файл с

sudo vigr

Формат записей группы может быть найден в человеке. От man group:

NAME
       group - user group file

DESCRIPTION
       The  /etc/group file is a text file that defines the groups on the system.  There is one entry per line,
       with the following format:

           group_name:password:GID:user_list

       The fields are as follows:

       group_name  the name of the group.

       password    the (encrypted) group password.  If this field is empty, no password is needed.

       GID         the numeric group ID.

       user_list   a list of the usernames that are members of this group, separated by commas.

FILES
       /etc/group
1
ответ дан 2 December 2019 в 08:31

Просто сделайте это:

sudo vim /etc/group

и добавьте свое имя к желаемой группе, как:

somegroup:x:25:yourusername
-1
ответ дан 2 December 2019 в 08:31

это сработало для меня:

sudo usermod -aG dialout amashreghi
0
ответ дан 15 March 2020 в 19:14

Другие вопросы по тегам:

Похожие вопросы: