創作內容

1 GP

[Linux][CentOS 5.5] 3.使用者管理

作者:game2002│2011-02-21 15:04:50│巴幣:0│人氣:450
3.使用者管理

題目:(如果連英文都看不懂,我也不知道該說啥?

  1. Add a new group "engineers" to both of your system (server1 and server2). The GID of this group is 1100.
  2. Add the following users to both of your systems (server1 and server2 ) whose primary group is "users" and who are also member if group "engineers":
  3. The home directories of these users have to be created below /home. The password for each user has to be set to "linux"(ignore all warning messages).
  4. Create an new user called alex and no interactive shall priority for alex.

Name username UID
Thomas Barness tbarnes 1001
Miguel Perez mperez 1002
James King jking 1003

1. 新增群組engineers並且設定UID為1100
[root@station8 ~]# groupadd   engineers   -g   1100
[root@station8 ~]# cat /etc/group   |   grep   engineers
engineers:x:1100:
可以輸入groupadd --help 來看設定UID的參數為何?

2. 新增使用者,依照上面的表格。並且建立家目錄。
[root@station8 ~]# useradd tbarnes -c "Thomas Barness" -m -g users -G engineers -u 1001
[root@station8 ~]# useradd mperez -c "Miguel Perez"  -g users -G engineers -u 1002
[root@station8 ~]# useradd jking -c "James King"  -g users -G engineers -u 1003

3. 設定密碼。
[root@station8 ~]# passwd tbarnes
Changing password for user tbarnes.
New UNIX password: (題目要求輸入linux當密碼
BAD PASSWORD: it is too short
Retype new UNIX password:
passwd: all authentication tokens updated successfully.

( 然後再使用同樣的指令passwd去設定另外兩位新使用者perez與jking

4. 最後確認。
[root@station8 ~]# cat /etc/passwd
tbarnes:x:1001:100:Thomas Barness:/home/tbarnes:/bin/bash
mperez:x:1002:100:Miguel Perez:/home/mperez:/bin/bash
jking:x:1003:100:James King:/home/jking:/bin/bash


5. 新增無interactive shall 權限的使用者,alex

[root@station4 ~]# useradd alex
[root@station4 ~]# passwd alex
Changing password for user alex.
New UNIX password:
BAD PASSWORD: it is too short
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@station4 ~]# nano /etc/passwd

alex:x:502:502::/home/alex:/bin/false
將原本的 bash 改為 false 即可
引用網址:https://home.gamer.com.tw/TrackBack.php?sn=1239379
All rights reserved. 版權所有,保留一切權利

相關創作

留言共 0 篇留言

我要留言提醒:您尚未登入,請先登入再留言

1喜歡★gameculb2002 可決定是否刪除您的留言,請勿發表違反站規文字。

前一篇:[Linux][Cent... 後一篇:[Linux][Cent...

追蹤私訊切換新版閱覽

作品資料夾

colanncolann
想找發明、小說、繪圖、漫畫、動畫、配音、音樂、模型的創作者們,一起交流、交友、交往! >.0看更多我要大聲說2小時前


face基於日前微軟官方表示 Internet Explorer 不再支援新的網路標準,可能無法使用新的應用程式來呈現網站內容,在瀏覽器支援度及網站安全性的雙重考量下,為了讓巴友們有更好的使用體驗,巴哈姆特即將於 2019年9月2日 停止支援 Internet Explorer 瀏覽器的頁面呈現和功能。
屆時建議您使用下述瀏覽器來瀏覽巴哈姆特:
。Google Chrome(推薦)
。Mozilla Firefox
。Microsoft Edge(Windows10以上的作業系統版本才可使用)

face我們了解您不想看到廣告的心情⋯ 若您願意支持巴哈姆特永續經營,請將 gamer.com.tw 加入廣告阻擋工具的白名單中,謝謝 !【教學】