docker
그룹이 존재함 을 확인합니다.
$ grep -i docker /etc/group
docker:x:130:
하지만 시도하면 usermod -aG docker
다음을 사용하여 출력을 얻습니다.
$ sudo usermod -aG docker
Usage: usermod [options] LOGIN
Options:
-c, --comment COMMENT new value of the GECOS field
-d, --home HOME_DIR new home directory for the user account
-e, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
-f, --inactive INACTIVE set password inactive after expiration
to INACTIVE
-g, --gid GROUP force use GROUP as new primary group
-G, --groups GROUPS new list of supplementary GROUPS
-a, --append append the user to the supplemental GROUPS
mentioned by the -G option without removing
him/her from other groups
-h, --help display this help message and exit
-l, --login NEW_LOGIN new value of the login name
-L, --lock lock the user account
-m, --move-home move contents of the home directory to the
new location (use only with -d)
-o, --non-unique allow using duplicate (non-unique) UID
-p, --password PASSWORD use encrypted password for the new password
-R, --root CHROOT_DIR directory to chroot into
-s, --shell SHELL new login shell for the user account
-u, --uid UID new UID for the user account
-U, --unlock unlock the user account
-v, --add-subuids FIRST-LAST add range of subordinate uids
-V, --del-subuids FIRST-LAST remove range of subordinate uids
-w, --add-subgids FIRST-LAST add range of subordinate gids
-W, --del-subgids FIRST-LAST remove range of subordinate gids
-Z, --selinux-user SEUSER new SELinux user mapping for the user account
확인해 보니 해당 그룹의 회원이 id
아니었습니다 .docker
내가 놓친 게 무엇입니까?
운영 체제: 우분투 16.04
답변1
필수 매개변수가 누락되었습니다.
아마도 당신은 필요할 것입니다LOGIN
, 필수 매개변수 지정을 참조하십시오'용법:'정보.
너무 길어요.
usermod -a -G docker <your username>
또한보십시오:
gpasswd -a <your username> docker
newgrp docker
이것이 적용되는지 확인하려면 로그인하거나 다시 사용하는 것을 잊지 마십시오 .