Linux -- gpasswd
GPASSWD(1)??????????????????????????????????????????????????????????? 用戶命令?????????????????????????????????????????????????????????? GPASSWD(1)
名
?????? gpasswd - 管理員 /etc/group 和 /etc/gshadow
大
?????? gpasswd [選項] group
描
?????? The gpasswd command is used to administer /etc/group, and /etc/gshadow. Every group can have administrators, members and a password.
?????? System administrators can use the -A option to define group administrator(s) and the -M option to define members. They have all rights of
?????? group administrators and members.
?????? gpasswd called by a group administrator with a group name only prompts for the new password of the group.
?????? If a password is set the members can still use newgrp(1) without a password, and non-members must supply the password.
?? 請 ?
?????? Group passwords are an inherent security problem since more than one person is permitted to know the password. However, groups are a useful
?????? tool for permitting co-operation between different users.
選
?????? 除了 -A 和 -M 選項,其它選項不能聯合使用。
?????? gpasswd 可以接受的選項有:
?
*****************************************************************************************************************************
?????? -r, --remove-password
?????????? Remove the password from the named group. The group password will be empty. Only group members will be allowed to use newgrp to join the
?????????? named group.
?????? -R, --restrict
?????????? Restrict the access to the named group. The group password is set to "!". Only group members with a password will be allowed to use
?????????? newgrp to join the named group.
?
*****************************************************************************************************************************
?????? -A, --administratorsuser,...
?????????? 設置有管理權限的用戶列表。
?????? -M, --membersuser,...
?????????? 設置組成員列表。
?????? -a, --adduser
?????????? 向名為 group 的組中添加用戶 user。
?????? -d, --deleteuser
?????????? 從名為 group 的組中移除用戶 user。
****************************************************************************************************************************
?????? -h, --help
?????????? 現實幫助信息并退出。
?????? -Q, --rootCHROOT_DIR
?????????? Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory.
?
CAVEATS
?????? This tool only operates on the /etc/groupand /etc/gshadow files.? Thus you cannot change any NIS or LDAP group. This must be performed on
?????? the corresponding server.
配
?????? 在 /etc/login.defs 中有如下配置變量,可以用來更改此工具的行為:
?????? ENCRYPT_METHOD (string)
?????????? 這定義了系統加密密碼的默認算法(如果沒有在命令行上指定算法)。
?????????? 可以使用如下值:DES (default), MD5, SHA256, SHA512.
?????????? 注意,此參數會覆蓋 MD5_CRYPT_ENAB 變量。
?????????? 注意:這只影響組密碼的產生。用戶密碼的產生是由 PAM 和 PAM 配置負責的。建議設置此變量和 PAM 配置一致。
?????? MAX_MEMBERS_PER_GROUP (number)
?????????? 每個組條目的最大成員數。達到最大值時,在 /etc/group 開始一個新條目(行)(使用同樣的名稱,同樣的密碼,同樣的 GID)。
?????????? 默認值是 0,意味著組中的成員數沒有限制。
?????????? 此功能(分割組)允許限制組文件中的行長度。這對于確保 NIS 組的行比長于 1024 字符。
?????????? 如果要強制這個限制,可以使用 25。
?????????? 注意:分割組可能不受所有工具的支持(甚至在 Shadow 工具集中)。您不應該使用這個變量,除非真的需要。
?????? MD5_CRYPT_ENAB (boolean)
?????????? 表示密碼是否必須使用基于 MD5 的算法加密。如果設為 yes,新密碼將使用可以和新版 FreeBSD 兼容的基于 MD5
?????????? 的算法加密。它支持無限長度的密碼以及更長的鹽字符串。如果您需要將加密的密碼復制到其它不理解新算法的系統,設置為 no。默認值是 no。
?????????? This variable is superseded by the ENCRYPT_METHOD variable or by any command line option used to configure the encryption algorithm.
?????????? 此變量已經廢棄。您應該使用 ENCRYPT_METHOD。
?????????? 注意:這只影響組密碼的產生。用戶密碼的產生是由 PAM 和 PAM 配置負責的。建議設置此變量和 PAM 配置一致。
?????? SHA_CRYPT_MIN_ROUNDS (number), SHA_CRYPT_MAX_ROUNDS (number)
?????????? ENCRYPT_METHOD 設為 SHA256 或 SHA512 時,此項確定加密算法默認使用 SHA 輪轉數目(當輪轉數沒有通過命令行指定時)。
?????????? 使用很多輪轉,會讓暴力破解更加困難。但是需要注意,認證用戶時也會需要更多的 CPU 資源。
?????????? 如果沒有指定,libc 會選擇默認的輪轉數(5000)。
?????????? 值必須在 1000 - 999,999,999 之間。
?????????? 如果只設置了一個 SHA_CRYPT_MIN_ROUNDS 或 SHA_CRYPT_MAX_ROUNDS 值,就會使用這個值。
?????????? 如果 SHA_CRYPT_MIN_ROUNDS > SHA_CRYPT_MAX_ROUNDS,將會使用大的那個。
?????????? 注意:這只影響組密碼的產生。用戶密碼的產生是由 PAM 和 PAM 配置負責的。建議設置此變量和 PAM 配置一致。
文
?????? /etc/group
?????????? 組賬戶信息。
?????? /etc/gshadow
?????????? 安全組賬戶信息。
參
?????? newgrp(1), groupadd(8), groupdel(8), groupmod(8), grpck(8), group(5), gshadow(5).
shadow-utils 4.1.5.1???????????????????????????????????????????????? 2014-02-17????????????????????????????????????????????????????????? GPASSWD(1)
轉載于:https://www.cnblogs.com/IceSword-syy/p/3953414.html
總結
以上是生活随笔為你收集整理的Linux -- gpasswd的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: HRESULT 的判断
- 下一篇: 操作系统之文件管理:8、文件系统实例