redhat linux dns+samba

Dns

 

实验环境:2个虚拟机、配置好yum源、检查网络状态

dns server:(192.168.0.210)

1) yum install bind bind-utils bind-libsbind-chroot

2) service named start

3) 修改named配置文件

         /var/named/chroot/etc/named.conf

         /etc/named.conf

        

listen-on port53 { any; };

listen-on-v6port 53 { any; };

forwarders {192.168.0.254; };

forward only;

allow-query     { any; };       

//allow-query     { localhost;192.168.0.0/24; };

dnssec-validation no;

4)修改dns配置文件  /etc/resolv.conf

         search                        example.com

nameserver            192.168.0.254

5)修改iptables:                tcp、udp 53

 

client:

1)      修改dns配置文件 /etc/resolv.conf

nameserver 192.168.0.210

 

测试:

1)      hostdemo.example.com

host192.168.0.250

host demo 192.168.0.250

host192.168.0.250 192.168.0.250

host -lexample.com 192.168.0.250

2)      nslookup

3)      dig

 

samba:

yum install samba samba-common samba-client

service smb start

 

修改iptables:

UDP 137,138 TCP 139,445

 

setsebool -P samba_enable_home_dirs=1

setsebool -P samba_export_all_ro=1

setsebool -P samba_export_all_rw=1

 

修改smb.conf    /etc/samba/smb.conf

share:

[global]

        workgroup = MYGROUP

        server string = SambaServer Version %v

 

        security = share

 

[test]

        comment = Directory for sharing

        path = /tmp/test

        read only = yes

        guest only = yes

 

[printers]

        comment = All Printers

        path =/var/spool/samba

        browseable = yes

        guest ok = yes

        printable = yes

 

smbclient -L //192.168.1.100

smbclient -L //192.168.1.100 -N

mount -t cifs //192.168.1.100/test /media/

mount -t cifs -o guest //192.168.1.100/test/media/

 

user:

[global]

       workgroup = MYGROUP

       server string = Samba Server Version %v

 

       security = user

 

[homes]

        comment = Home Directories

       valid users = %S

       read only = no

       browseable = no

 

[test]

       comment = Directory for testing

       path = /tmp/test

       force user = leon

       force group = leon

       guest ok = yes

         readonly = no

 

[printers]

       comment = All Printers

       path = /var/spool/samba

       browseable = yes

       guest ok = yes

       printable = yes

 

pdbedit -au leon

-L               (listall users)

-v

-u               (specifyuser)

-a               (adduser)

-r                (modifyuser)

-x               (removeuser)

 

smbclient -L //192.168.1.100 -U leon

mount -t cifs -o user=leon,password=abc//192.168.1.100/test /media/

 

fstab:

//192.168.1.100/test    /media                  cifs    user=leon,password=abc 0 0

 

autofs:

smb             -fstype=cifs,user=leon,password=abc://192.168.1.100/test

------------------------------------------------------------

server:

/etc/grub.conf->console=ttyS0

 

client:

minicom -p /dev/pts/1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值