Linux下添加一用戶Sunrier並設置密碼為RedHat:
su -
輸入密碼
pwconv
useradd Sunrier
pwunconv
pwconv
passwd Sunrier
redhat
pwunconv
改變檔案的擁有者
chown -R user[:group] file
user : 新的檔案擁有者的使用者 ID
group: 新的檔案擁有者的使用者群體(group),為可選項
-R : 對目前目錄下的所有檔案與子目錄進行相同的擁有者變更(即以遞回的方式逐個變更)
例:
[root@localhost Sunrier]# ls -l
總計 6
drwxr-xr-x 3 root root 4096 07-31 11:11 src
[root@localhost Sunrier]# chown -R Sunrier:Sunrier src
[root@localhost Sunrier]# ls -l
總計 6
drwxr-xr-x 3 Sunrier Sunrier 4096 07-31 11:11 src
[root@localhost Sunrier]#