【文章內(nèi)容簡介】
進(jìn)去后,退出來按q用戶管理(1)用戶名與密碼保存的文件[root@fileserver ~] useradd dhxy01[root@fileserver ~] passwd stdin dhxy01Changing password for user dhxy01.redhatpasswd: all authentication tokens updated successfully.[root@fileserver ~][root@fileserver ~] tail 1 /etc/passwddhxy01:x:500:500::/home/dhxy01:/bin/bash[root@fileserver ~] tail 1 /etc/shadowdhxy01:$1$TJUtgaBc$kqbO8oVWnJTqvqIhkEYEB1:17149:0:99999:7:::[root@fileserver ~][root@fileserver ~] tail 1 /etc/groupdhxy01:x:500:當(dāng)我們創(chuàng)建一個用戶,用戶信息保存在/etc/passwd文件,密碼保存在/etc/shadow,組的信息保存在/etc/group(2)useradd 作用:添加用戶 u 指定用戶ID號 g 指定用戶屬于哪個主組 G 指定用戶屬于哪個附屬組 s 指定用戶使用的SHELL,Linux主要使用的是/bin/bash d 指定用戶家目錄創(chuàng)建一個用戶user01,主組為root,附屬組為user,用戶的ID號為2000,此用戶不允許登錄,家目錄為/user[root@fileserver ~] useradd g root G user u 2000 s /sbin/nologin d /user user01[root@fileserver ~][root@fileserver ~] id user01uid=2000(user01) gid=0(root) groups=0(root),501(user)[root@fileserver ~] tail 1 /etc/passwduser01:x:2000:0::/user:/sbin/nologin(3)usermod 作用:修改用戶屬性 u 改變用戶ID號 g 改變用戶主組 G 改