網站首頁 學習教育 IT科技 金融知識 旅遊規劃 生活小知識 家鄉美食 養生小知識 健身運動 美容百科 遊戲知識 綜合知識
當前位置:趣知科普吧 > IT科技 > 

linux設定權限的命令

欄目: IT科技 / 發佈於: / 人氣:4.84K

設定檔案夾權限:

1、首先要檢視linux系統版本,比如cat /etc/redhat-release ,然後進入到需要檢視的檔案夾目錄。

linux設定權限的命令

2、修改設定檔案夾權限通常是使用chmod命令,比如“chmod 755 檔案目錄名”。

linux設定權限的命令 第2張

設定用戶權限:

1、添加用戶
首先要用adduser命令添加一個普通用戶,命令如下:
#adduser tommy //添加一個名爲tommy的用戶
#passwd tommy //修改密碼
Changing password for user tommy.
New UNIX password: //在這輸入新密碼
Retype new UNIX password: //再次輸入新密碼
passwd: all authentication tokens updated successfully.
2、賦予root權限
修改 /etc/sudoers 檔案,找到下面一行,將前面的註釋符號(#)去掉
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
接着修改用戶,讓其能夠屬於root組(wheel),具體命令是:
#usermod -g root tommy

修改完畢之後就能夠使用tommy帳號登入,接着用命令su -,就可以獲得root權限進行其他操作了。