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

Jenkins : 安装 master 和 slave

[日期:2016-03-01] 来源:Linux社区  作者:Linux [字体:大 中 小]

33、问题6:打印机设置
#使用 IPP(CUPS)设定您系统上的预设本地打印机列至 server1.example.com 上的 stationX,设定该印表机时请使用 “Generic-text-only”印表机。
 
#system-config-printer
#echo “station6.example.com” | lpr
#firefox
登陆地址检查打印情况
34、问题7:定时任务列表与NTP设置
#为用户 naima 设立一个任务计划,在本地时间每天 20:45 执行/bin/echo hello
设定您的系统为 server1.example.com 的NTP 客户端
#crontab  –u naima –e
45  20  *  *  *  /bin/echo  hello
:wq
#service  crond  restart
#crondtab  -u naima  -l
45  20  *  *  *  /bin/echo  hello
设定您的系统为 server1.example.com 的NTP 客户端
 
35、问题4:权限设置
将 /etc/fstab 文件复制到 /tmp,设定 /tmp/fstab 的权限,使:
#/tmp/fstab 文件的属主是 root 使用者
#/tmp/fstab 文件的所属群组是 root 群组
#/tmp/fstab 文件不得为任何人执行
#使用者 naima 可以读写 /tmp/fstab
#所有其他使用者(目前的及未来的)可以读取 /tmp/fstab
 
答案:
#cp  /etc/fstab  /tmp/
#ll  /tmp/
#getfacl  /etc/fstab
#setfacl  -m u:naima:rw  /tmp/fstab
#getfacl  /etc/fstab
 
36、问题5:内核升级和路由启用
#在您的系统上启用 IP Forwarding 功能,并使之永久生效
#vim /etc/sysctl.conf
Net.ipv4.ip_forward = 1
:wq
 
从ftp://server1.example.com/pub/updates 安装适用的 kernel 更新套件,必须符合下列准则:
#更新版的 kernel 套件在重新开机后为预设的 kernel,原来的 kernel 套件依旧存在,并且可以手动启用
#lftp  server1.example.com
>cd  pub
>cd  updates
>get  kernel*
>exit
#rpm –ivh kernel*
#vim  /boot/grub/grub.conf
Default=1
 
37、问题2:账户管理
#建立 staff 群

#建立 naima 用户,使其附属于 staff 群组
#建立 taliesin 用户,使其附属于staff 群组
#建立 simira 用户,使其无法交互式登录本地系统,且不是 staff 群组成员
#以上使用者naima、talisin及simira 的密码均为 passwd
 
答案:
#groupadd staff
#useradd  –G staff  naima
#useradd  -G staff  taliesin
#useradd  –s /sbin/nologin simira
#passwd  naima
Passwd
#passwd  taliesin
Passwd
#passwd  simira
Passwd
 
38、问题3:共享目录设置
建立一个工作目录于 /commom/staff ,并拥有下列属性:
#/shared/staff 的所属群组为 staff;
#该目录应对 staff 群组成员有可读、可写、可执行的权限;
#对taliesin没有任何权限
#对其他使用者有可读的权限
 
答案:
#mkdir –p /commom/staff
#chown  .staff  /commom/staff
#ll –d  /commom/staff
#chmod 775 /commom/staff
#getfacl  /commom/staff
#setfacl  -m u:taliesin:0  /commom/staff
#getfacl  /commom/staff
 
39、依下列要求,配置您的SMTP邮件服务:
您的邮件服务器必须可以接受来自本地端及来自远端的邮件
Susan必须可以从远端主机接收邮件
寄给susan的邮件,必须存放在/var/spool/mail/susan的邮件队列中
iptables –A INPUT –p tcp –dport 25 –j ACCEPT
/etc/init.d/iptables save
/etc/init.d/iptables restart
              yum install sendmail-cf
              chkconfig sendmail on
              vi /etc/mail/local-host-names
                    exampel.com
                    stationX.example.com
              :wq
vi /etc/mail/sendmail.mc
                    127.0.0.1---à0.0.0.0
      :wq
      service sendmail restart
      mail susan
        subject :
        .
ls /var/spool/mail
        susan
 
40、通过NFS服务,将/common目录输出给example.com域
      yum install nfs
      yum install portmap
      service portmap start
chkconfig portmap on
      chkconfig nfs on
      vi /etc/exports
      /common        172.24.0.0/16 (rw,sync)
      :wq
service nfs restart
测试:showmount –e 可以看到本机的nfs输出
 
41、为您的MTA配置一个邮件别名,将发送给acctmgr的邮件转至本地的andrew用户
yum install sendmail*
yum install sendmail-cf*
vim /etc/mail/sendmail.mc
把127.0.0.1改为0.0.0.0   
m4 sendmail.mc > sendmail.cf
vim /etc/mail/local-host-names
加入example.com
stationX.example.com保存退出
chkconfig sendmail on
service sendmail restart
vi /etc/aliase
              acctmgr:          andrew
      :wq
      newaliase重新加载
 
42、配置您系统上的FTP访问:Example.com网域中的客户端都可以用匿名(anonymous)访问您的机器Example.com 网域外的客户端都不能访问您的FTP服务
yum install vsftpd*
service vsftpd restart
chkconfig vsftpd on
iptables –A INPUT –s ! 172.24.0.0/16 –p tcp –dport 21 –j REJECT
iptables –A INPUT –s ! 172.24.0.0/164 –p udp –dport 21 –j REJECT
service iptables save
 
方法二
yum -y install vsftpd
chkconfig vsftpd on
service vsftpd restart
getsebool –a | grep ftp
setsebool -P ftp_home_dir 1
service vsftpd restart
vim /etc/hosts.allow vsftpd: .example.com
vim /etc/hosts.deny vsftpd: ALL EXCEPT .example.com
netstat -tulpn | grep vsftp
service iptables save
service iptables restart
 
43、通过SMB共享/common目录:您的SMB服务器须设定为STAFF工作组的成员共享名称需要设定为“common”只共享给example.com网域内的客户端共享必须是可浏览的(browseable) Susan可以读取这个共享目录以及对应的家目录,如果必要的话,使用的密码为password
yum install samba.i*
chkconfig smb on
vim /etc/samba/smb.conf
cd /etc/samba
grep –v “^#” smb.conf  >smb.con
        [common]
                            workgroup = STAFF
                            path = /common
                            hosts allow = 172.24.0.0/16
                            browseable = yes
                            guest ok =yes
:wq
service smb restart
测试:smbclient –L //172.24.0.9
mkdir /common
chcon –t samba_share_t /common
useradd susan
smbpasswd –a susan
vim /etc/samba/smb.conf
把[homes]下的valid 前的;去掉。保存退出
service smb restart
 
44、设定您的网站服务,网址是http://stationX.example.com,然后执行下列步骤:
下载ftp://server1.example.com/pub/rhce/station.html文件
将下载的文件重新命名为index.html
将文件复制到您的网站的documentroot路径下
切勿更动index.html文件的内容
yum install httpd
chkconfig httpd on
wget ftp://server1.example.com/pub/rhce/station.html
cp station.html /var/www/html/index.html
vim /etc/httpd/conf/httpd.conf
修改ServerName stationX.example.com
chcon -R --reference=/var/www/html  /var/www/html/index.html
service httpd restart
 
45、依照下原则配置您的系统上的POP3服务Brad可以通过POP3协议从example.com 网域内取回在您系统上的信件my133t.org的客户不能访问您系统上的POP3服务
iptables –A INPUT –s ! 172.24.0.0/16 –p tcp –dport 110 –j REJECT
      iptables –A INPUT –s ! 172.24.0.0/164 –p udp –dport 110 –j REJECT
      service iptables save
 
 
#yum -y install dovecot*
chkconfig dovecot on
service dovecot restart
vim /etc/dovecot.conf 搜索protocols 注释开
service dovecot restart
getsebool –a | grep dovecot
iptables -A INPUT –s 172.24.0.0/16 –p tcp –dport 110 –j ACCEPT
iptables -A INPUT –p tcp –dport 110 –j REJECT
service iptables save
service iptables restart
 
echo “hello,tom” | mail –s hello tom
su tom
mutt –f pop://tom@station5.example.com
 
46、找出所有属于susan用户的文件,并且把这些文件放到/temp/susan目录中
如果没有/temp/susan目录,则需要先创建该目录
#mkdir –p /temp/susan
# find / -user susan -exec cp  {}  /temp/susan  \;
 
47、1、SELINUX必须运行在强制模式
              vi /etc/sysconfig/selinux
                    SELINUX=enforcing
      :wq

        2、以下列指示配置SSH访问 Susan可以从example.com域内远程ssh访问您的机器My133t.org 域内的客户不能通过SSH访问您的机器
iptables –F
iptables –A INPUT –s 172.25.0.0/16 –j REJECT
service iptables save
service iptables restart
chkconfig iptables on

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

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