【RHCE】
一、DNS服务器配置
1、安装bind
2、配置/etc/named.conf
两个地方注意
listen-on port 53 { 192.168.178.129; };
allow-query { any; };-侦听的端口需要 使用服务器IP,允许any
3、新建的解释文件需要转换named属组
-rw-r-----. 1 root named 220 Apr 4 19:43 ip2name_test.conf
-rw-r-----. 1 root named 248 Apr 4 19:43 name2ip_test.conf
4、重启named服务,留意一下 /var/log/messages 是否有报错信息。
5、客户端默认dns服务器配置 /etc/resolv.conf
nameserver 192.168.178.128
search test.com rhel.com #省略后缀,快捷搜索
6、配置文件范例
[root@RedHat1 named]# cat ip2name_test.conf
$TTL 1D
@ IN SOA @ rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS @
A 127.0.0.1
AAAA ::1
PTR localhost.
128 PTR redhat1.test.com.
129 PTR redhat2.test.com.
[root@redhat1 named]# cat name2ip_test.conf
$TTL 1D
@ IN SOA @ rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS @
A 127.0.0.1
AAAA ::1
redhat1 IN A 192.168.178.128
redhat2 IN A 192.168.178.129
www CNAME redhat1
mail CNAME redhat2
[root@redhat1 named]#vim /etc/named.rfc1912.zones
zone "test.com" IN {
type master;
file "name2ip_test.conf";
allow-update { none; };
};
zone "178.168.192.in-addr.arpa" IN {
type master;
file "ip2name_test.conf";
allow-update { none; };
};
二、SAMBA
安装:yum install samba samba-client
配置:/etc/samba/smb.conf
1、增加共享路径
[smbdata]
comment = smbgrp file
path = /data/smbdata
public = yes
guest ok=yes
; writeable = yes
; read only = yes
; available = yes
; write list = @smbgrp
; read list = @smbgrp
; browseable=no
; valid users=nobody
2、sampasswd -asmb1 #初始化本地用户密码数据到samba
授权三步
selinux 访问限制需要查看 man samba_selinux
一步:文件属性修改
chcon -R -t samba_share_t /sharefile
二步:操作系统本地文件授权访问:
setfact -m u:user1:rwx /sharefile
三步:/etc/samba/smb.conf #配置文件
[share]
path = /sharefile
write list = user1,user2 #user1,user2能写入