9、什么是符号链接,什么是硬链接?符号链接与硬链接的区别是什么?
答:符号链接:符号链接文件类似于Windows中的快捷方式,其本身并不保存文件内容,
只记录所链接文件的路径。
硬链接:硬链接文件保留所链接文件的索引节点(磁盘的具体物理位置)信息。 区别:即使被链接文件更名或者移动,硬链接文件仍然有效;而符号链接文件就无任
何意义。
10、某/etc/fstab文件中的某行如下所示,请解释其含义。
/dev/had5 /mnt/dosdata msdos defaults,usrquota 1 2
11、某系统管理员需每天做一定的重复工作,请按照下列要求,编制一个解决方案: (1)在下午4 :50删除/abc目录下的全部子目录和全部文件; 答:50 16 *** rm –r /abc/*
(2)从早8:00~下午6:00每小时读取/xyz目录下x1文件中最后20行内容加入到/backup目
录下的bak01.txt文件内;
答:0 8~18/1 *** tail –n 20 /xyz/x1 >> /backup/bak01.txt 12、修改eth0的ip地址有哪些方法(至少写出两个)?
五、服务器配置题 1、某主机的IP地址为202.127.92.10,要求设置两个虚拟主机,其域名分别是name1.example.com和name2.example.com。虚拟主机参考代码如下: # VirtualHost example: #
# ServerAdmin webmaster@dummy-host.example.com # DocumentRoot /www/docs/dummy-host.example.com # ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common #
2、假设需要配置一个符合以下条件的主域名服务器:域名注册为example.com,网段地址为202.127.50.*;主域名服务器的IP地址为202.127.50.100,主机名为dns.example.com;要解析的服务器有:www.example.com(IP地址为202.127.50.100),ftp.example.com(IP地址为202.120.50.200)。
/var/named/chroot/etc/named.caching-nameserver.conf文件内容如下: options {
listen-on port 53 { 127.0.0.1; };
listen-on-v6 port 53 { ::1; }; directory \
dump-file \ statistics-file \
memstatistics-file \
// Those options should be used carefully because they disable port // randomization
// query-source port 53; // query-source-v6 port 53;
allow-query { localhost; }; allow-query-cache { localhost; }; };
logging {
channel default_debug {
file \ severity dynamic; }; };
view localhost_resolver {
match-clients { localhost; }; match-destinations { localhost; }; recursion yes;
include \};
zone \
type hint;
file \};
zone \ type master;
file \ allow-update { none; }; };
/var/named/chroot/etc/named.rfc1912.zones文件内容如下: zone \ type master;
file \ allow-update { none; }; };
zone \ type master;
file \ allow-update { none; }; };
zone \IN { type master;
file \ allow-update { none; }; };
zone \ type master;
file \ allow-update { none; }; };
zone \ type master;
file \
allow-update { none; }; };
/var/named/chroot/var/named/named.zero文件内容如下: $TTL 86400
@ IN SOA localhost. root.localhost. (
42 ; serial (d. adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum IN NS localhost.
/var/named/chroot/var/named/named.local文件内容如下: $TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum IN NS localhost. 1 IN PTR localhost.
3、架设用户级别的Samba服务器,其中jerry和helen用户可访问其个人主目录、/tmp目录和/var/samba/hel-jerry目录,而其他的linux普通用户只能访问其个人主目录和、/tmp目录。假设jerry和helen用户已存在,/var/samba/hel-jerry目录也已存在,工作组为workgroup。请根据以上要求配置smb.conf文件,未配置过的smb.conf主要内容如下所示。
#======================= Global Settings =====================================
[global]
# ----------------------- Network Related Options ------------------------- workgroup = MYGROUP
server string = Samba Server Version %v ; netbios name = MYSERVER
; interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24 ; hosts allow = 127. 192.168.12. 192.168.13.
# --------------------------- Logging Options ----------------------------- ; log file = /var/log/samba/%m.log ; max log size = 50
# ----------------------- Standalone Server Options ------------------------ security = user
passdb backend = tdbsam
# --------------------------- Printing Options ----------------------------- load printers = yes cups options = raw
; printcap name = /etc/printcap ; printcap name = lpstat ; printing = cups
#============================ Share Definitions ============================== [homes]
comment = Home Directories browseable = no writable = yes ; valid users = %S
; valid users = MYDOMAIN\\%S [printers]
comment = All Printers path = /var/spool/samba browseable = no guest ok = no writable = no printable = yes ; [public]
; comment = Public Stuff ; path = /home/samba ; public = yes ; writable = yes ; printable = no
; write list = +staff