手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

红帽RHCSA及RHCE认证练习题及操作步骤

[日期:2012-06-18] 来源:Linux社区  作者:Linux [字体:大 中 小]

#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>

linux
相关资讯       RHCSA 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款