RHEL6入門系列之十八,階段練習2

2021-09-21 22:49:44 字數 3603 閱讀 5305

一、選擇題

1、red hat enterprise linux系統中預設的管理員使用者是什麼()?

a、administrator    b、admin     c、root     d、master

2、在linux作業系統中,存放使用者賬號加密口令的檔案是( )。

a./etc/sam b./etc/shadow c.etc/group d.etc/security

3、使用者賬戶資訊服務通常提供哪七項資訊?( )

a、 使用者名稱、phone、uid、gid、gecos、/home/dir、shell

b、 使用者名稱、密碼、uid、gid、gecos、/home/dir、shell

c、 test、使用者名稱、uid、gid、gecos、/home/dir、shell

d、使用者名稱、密碼、uid、gid、phone、/home/dir、shell

4、採用root身份,使用命令ln –s建立當前目錄下test(檔案屬主為guest)的符號鏈結test.link,並將test.link的屬主由root改變為nobody,則最後檔案test的屬主為( )?

a、root     b、guest      c、nobody     d、其他

5、為匹配以001開頭的行,我們可以使用如下的正規表示式( )

a. ^001    b. $001    c. *001    d. \001

6、若需設定檔案的屬主使用者有讀取、寫入許可權,而其他任何使用者只能進行唯讀訪問,則許可權模式可以表示為( )?

a、566     b、644     c、655     d、764

7、在linux作業系統中,命令「chmod -777 /home/abc」的作用是( )。

a.把所有的檔案拷貝到公共目錄abc中

b.修改abc目錄的訪問許可權為可讀、可寫、可執行

c.設定使用者的初始目錄為/home/abc

d.修改abc目錄的訪問許可權為對所有使用者唯讀

8、使用者user(也是sales組的成員)能對下面檔案進行什麼操作( )?

-r--rw-r-x 1 user sales 2887 sep 7 12:06 test.

a、 讀寫    b、 唯讀    c、讀和執行    d、 讀寫執行

9、下面命令中,哪個用於密碼修改( )?

a、 password    b、 pwd    c、 change    d、 passwd

10、記錄gid與組名稱的檔案是( )?

a、 /etc/passwd   b、 /usr/group   c、 /etc/pgroup   d、 /etc/group

11、以下( )命令可以將檔案xfile的許可權設定為屬主使用者唯讀。

a. chmod a=r xfile          b. chmod u=r xfile

c. chmod g-wx xfile         d. chmod o+r xfile

12、使用以下( )命令可以改變檔案或目錄的屬組。

a. chmod   b.chown   c.groups   d.chgrp

13、vim a.txt,現要將a.txt檔案裡的所有old替換為new,如何操作( )?

a、 :% s/old/new/g      b、 :/old/new

c、 :s/old/new          d、 :s/old/new/s

14、檢視當前目錄下file1檔案的大小和屬主屬性可用以下哪個命令( )?

a、 ls –l file1    b、 ls –s file1

c、 ls –b file1    d、 ls –a file1

15、建立乙個組名字為tech並且組id為300的命令是什麼( )?

a、 addgroup 300 tech       b、 groupadd –g 300 tech

c、 newgrp –g 300 tech     d、 groups --gid 300 --name tech

二、操作題

1、建立目錄「/tech/accp」。

2、建立組賬號accp,gid為1001;建立組賬號tech,gid為1002。

3、建立使用者賬號:jerry、obama,主目錄均使用「/tech/accp/」目錄中與賬號同名的資料夾(即/tech/accp/jerry、/tech/accp/obama),2個使用者賬號的基本組都是accp,附加組都是tech。

4、建立使用者strlt,指定其uid為1000,並且不允許登入。

5、為上述3個使用者賬號設定初始密碼「123456」。

6、將「/tech」目錄的屬組設定為tech,允許root使用者以及tech組內的成員具有讀寫執行許可權,其他使用者沒有任何許可權。

7、將整個/etc目錄打包壓縮成包檔案etc.tar.gz。

8、檢視etc.tar.gz檔案中所包含的檔案和目錄列表。

9、檢視/etc目錄的大小

10、檢視etc.tar.gz檔案的大小。

11、將etc.tar.gz檔案解壓並釋放到/tech目錄下。

12、刪除/tmp/etc目錄。

選擇題參***:

1~5 cbbba       6~10 bbbdd     11~15 b(12題b或d都可以)aab

操作題參***:

1、[root@localhost ~]# mkdir -p /tech/accp

2、[root@localhost ~]# groupadd -g 1001 accp

[root@localhost ~]# groupadd -g 1002 tech

3、[root@localhost ~]# useradd -g accp -g tech -d /tech/accp/jerry jerry

[root@localhost ~]# useradd -g accp -g tech -d /tech/accp/obama obama

4、[root@localhost ~]# useradd -u 1000 -s /sbin/nologin strlt

5、[root@localhost ~]# passwd jerry

[root@localhost ~]# passwd obama

[root@localhost ~]# passwd strlt

6、[root@localhost ~]# chown :tech /tech

[root@localhost ~]# ll -d /tech

drwxrwx---. 3 root tech 4096 1月 10 14:43 /tech

[root@localhost ~]# chmod 770 /tech

7、[root@localhost ~]# tar zcvf etc.tar.gz /etc

8、[root@localhost ~]# tar ztvf etc.tar.gz | more

9、[root@localhost ~]# du -hs /etc

10、[root@localhost ~]# du -h etc.tar.gz

11、[root@localhost ~]# tar zxvf etc.tar.gz -c /tech

12、[root@localhost ~]# rm -rf /tech/etc

RHEL6入門系列之三十,服務管理

服務是在系統後台執行,並等待使用者或其它軟體呼叫的一類特殊程式。由於linux主要是用作伺服器作業系統,因而當學習完入門課程之後,接下來就要學習對各種常用服務的配置與管理,如實現web伺服器的httpd服務 實現ftp伺服器的vsftpd服務 實現郵件伺服器的postfix服務等。在我們的入門課程中...

RHEL6入門系列之三十,服務管理

服務是在系統後台執行,並等待使用者或其它軟體呼叫的一類特殊程式。由於linux主要是用作伺服器作業系統,因而當學習完入門課程之後,接下來就要學習對各種常用服務的配置與管理,如實現web伺服器的httpd服務 實現ftp伺服器的vsftpd服務 實現郵件伺服器的postfix服務等。在我們的入門課程中...

RHEL6入門系列之九,常用命令2

今天還是繼續來學習linux的基本命令。4 touch命令 建立空檔案 touch命令用於建立空檔案。root localhost mkdir root test 建立目錄 root test root localhost touch root test test1.txt 在目錄 root tes...