管理本地Linux使用者和組之使用者和組

2021-09-29 19:57:28 字數 1371 閱讀 7242

系統中每個程序都作為乙個特定使用者執行,每個檔案歸乙個特定使用者所有。對檔案和目錄的訪問受到使用者的限制。與執行程序相關聯的使用者可確定該程序可訪問的檔案和目錄。

[student@desktopx ~]$ id

uid=1000(student) gid=1000(student) groups=1000(student)

,10(wheel)

context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

[student@serverx ~]$ ls

-l /tmp

drwx------

. 2 gdm gdm 4096 jan 24 13:05 orbit-gdm

drwx------

. 2 student student 4096 jan 25 20:04 orbit-student

-rw-r--r--

. 1 root root 23574 jan 24 13:05 postconf

[student@serverx ~]$ ps au

user pid %cpu %mem vsz rss tty stat start time command

root 428 0.0 0.7 152768 14400 tty1 ss+ feb03 0:04 /user/bin/xorg

root 511 0.0 0.0 110012 812 ttys0 ss+ feb03 0:00 /sbin/agetty

root 1805 0.0 0.1 116040 2580 pts/0 ss feb03 0:00 -bash

student 2110 0.0 0.1 116168 2864 pts/0 s feb03 0:00 -bash

student 3690 0.0 0.0 123368 1300 pts/0 r+ 11:42 0:00 ps au

預設情況下,系統使用( /etc/passwd檔案)儲存有關本地使用者的資訊。

密碼儲存在 /etc/shadow的單獨檔案中。

與使用者一樣,組也有名稱和編號(gid)。本地組在 /etc/group中定義。

主要組

補充組

groupname:gid:list,of,users,in,this,

group

補充組成員身份用於幫助確保使用者具有對系統中檔案及其他資源的訪問許可權。

Linux學習之使用者管理和組管理

一 linux系統上使用者和使用者組類別 使用者類別 1 管理員 uid 0 2 普通使用者 id 1 65535 2.1 系統使用者 id 1 499,一般不允許登陸系統 2.2 一般使用者 id 500 60000 組類別 1 管理員組 2 普通組 2.1 系統組 2.2 一般組 基本組 使用者...

linux 之使用者和組

使用者 和 組 usermod 使用者 s sbin nologin 禁止使用者登入 usermod 使用者 s bin bash 恢復已禁止的使用者登入 echo liuwang 123 chpasswd 修改使用者密碼為123 userdel r 使用者名稱 刪除使用者,r同時刪除使用者家目錄 ...

Linux之使用者和使用者組管理 使用者組管理命令

linux之使用者和使用者組管理 使用者組管理命令 盡量不要改使用者初始組 一 新增使用者組 root hhh groupadd hhhg 選項 g gid 指定組id 二 修改使用者組 root hhh groupmod 選項 組名 選項 g gid 修改組id n 新組名 修改組名 例子 roo...