Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> 關於Linux

Linux 帳號與群組基礎:passwd、group 與 chown

Linux 的帳號與群組主要記錄於 /etc/passwd 與 /etc/group。passwd 的欄位包含帳號、密碼、UID、GID、註解、家目錄與 shell;group 則包含群組名、群組密碼、GID 與成員列表。

Linux 帳號與群組基礎:passwd、group 與 chownLinux 帳號與群組基礎:passwd、group 與 chown

新增與修改帳號可使用 useradd 與 usermod,例如指定家目錄、群組與 shell。修改檔案擁有者則使用 chown:

useradd -d /home/users -m -g root -G qcfang -s /bin/csh test
usermod -d /home -s /bin/bash -g qcfang test
chown -R test a.txt
chown -R test:test a.txt
Copyright © Linux教程網 All Rights Reserved