3.使用者管理題目:(如果連英文都看不懂,我也不知道該說啥?)
- Add a new group "engineers" to both of your system (server1 and server2). The GID of this group is 1100.
- 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":
- 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).
- 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 engineersengineers: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 10033. 設定密碼。[root@station8 ~]# passwd tbarnesChanging 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/passwdtbarnes: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 alexChanging 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/passwdalex:x:502:502::/home/alex:/bin/
false(
將原本的 bash 改為 false 即可)