#SAMBA
Add a browseable sharing named “common”,path /common,192.168.0.0/24 can access only
Tom ,can writeable ,read show passwd 123
1’mkdir /common
2’yum –y install samb
3’vim /etc/smba/smb.conf
开write list ,则writeable=yes 不开
4’service smb restart ;chkconfig smb on
5’防火墙:
iptables -I INPUT -p tcp --dport 137:139 -s 192.168.0.0/24 -j ACCEPT
iptables -I INPUT -p udp -dport 137:139 -s 192.168.0.0/24 -j ACCEPT
iptables -I INPUT -p tcp --dport 445 -s 192.168.0.0/24 -j ACCEPT
iptables -I INPUT -p udp --dport 445 -s 192.168.0.0/24 -j ACCEPT
service iptables save
6’getsebool -a |grep samba ;setsebool –P samba_enable_home_dirs on
samba_export_all_rw 1
Use_samba_home_dirs 1
7’smbpasswd -a tom 123 123
8’chmod o+w /common
9’smbclient -L 192.168.0.9& smbclient //192.168.0.9:/common -U tom
#NFS
Using NFS Shared /common , 192.168.0.0/24access only
1’yum -y install nfs*
2’vim /etc/exports : /common 192.168.0.0/24(rw,sync)
3’service nfs restart ; chkconfig nfs on
4’防火墙规则:
vim /etc/sysconfig/nfs
端口号111,2049,4000:4002 tcp&udp 192.168.0.0/24 ACCEPT
5’验证:
mount -t 192.168.0.9:/common /mmm
cd /mmm
touch file3
ls
#SSH
192.168.0.0/24 access WEB port,
1’yum -y install sshd
2’service httpd start; chkconfig sshd on
3’ 防火墙:端口号22(tcp)
#WEB 访问控制
1’ ll -Z /var/www/html/
2’防火墙:端口号80:(tcp)
#WEB 虚拟主机
Download from the service ftp://192.168.0.254/pub/test/ virt.html
Rename index.html ,
http://www.domainX0.example.com to visit
1’mkdir -p /var/www/virt1
lftp 192.168.0.254 get virt.html
cp virt.html /var/www/virt1/index.html
2’vim /etc/httpd/conf/httpd.conf
编写两个虚拟主机
3’service httpd restart ;
#WEB 敌对域:
<Directory /var/www/virt1>
Order allow,deny
allow from all
deny from 192.168.1
</Directory>
