zoukankan      html  css  js  c++  java
  • 构建FTP服务


    一、配置YUM仓库服务
    --------------YUM服务器------------------client------------------
    192.168.1.1 192.168.1.10
    [root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
    [root@localhost ~# service network restart
    [root@localhost ~]# mount /dev/cdrom /mnt/
    [root@localhost ~]# vim /etc/yum.repos.d/rhel-source.repo
    修改:
    baseurl=file:///mnt/
    enabled=1
    [root@localhost ~]# yum -y install createrepo
    [root@localhost ~]# mkdir /var/ftp/other
    [root@localhost ~]# createrepo -g /mnt/repodata/repomd.xml /var/ftp/other/
    [root@localhost ~]# rpm -ivh /mnt/Packages/vsftpd-2.2.2-11.el6_4.1.x86_64.rpm
    [root@localhost ~]# service vsftpd restart
    [root@localhost ~]# mkdir /var/ftp/rhel6
    [root@localhost ~]# cp -rf /mnt/* /var/ftp/rhel6
    或者
    [root@localhost ~]# mount /dev/cdrom /var/ftp/rhel6
    验证:
    [root@localhost ~]# rpm -ivh /mnt/Packages/ftp-0.17-54.el6.x86_64.rpm
    [root@localhost ~]# ftp 192.168.1.1
    客户端验证:
    [root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
    [root@localhost ~]# service network restart
    [root@localhost ~]# vim /etc/yum.repos.d/rhel6.repo
    添加:
    [base]
    name=base
    baseurl=ftp://192.168.1.1/rhel6
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    [other]
    name=other
    baseurl=ftp://192.168.1.1/other
    enabled=1
    gpgcheck=0

    验证安装软件
    [root@localhost ~]# yum -y install createrepo
    成功!!!!!!!

    [root@localhost ~]# yum list //查询所有已经安装和可以安装的程序包
    [root@localhost ~]# yum info httpd //查询httpd的信息
    [root@localhost ~]# yum search all httpd //查询httpd相关软件包的信息
    [root@localhost ~]# yum clren all //清楚缓存
    [root@localhost ~]# yum grouplist
    [root@localhost ~]# yum groupinfo
    [root@localhost ~]# yum groupinfo Desktop
    [root@localhost ~]# yum -y install bind* //安装bind*相关软件包
    [root@localhost ~]# yum groupinsall "组名"
    [root@localhost ~]# yum -y remove bind* //删除bind*相关软件包
    [root@localhost ~]# yum -y groupremove "组名"
    [root@localhost ~]# yum deplist mysql-server

    例如:
    [root@localhost ~]# yum groupinstall "X Window System"
    [root@localhost ~]# yum groupinstall "GNOME Desktop Environment"
    [root@localhost ~]# yum groupinstall "KDE (K Desktop Environment)"

    **************************************************************************************8

    ------------------------FTP+Selinux--------------------
    # mount /dev/cdrom /media/cdrom/
    # yum install vsftpd -y
    # vim /etc/passwd
    ftp家目录/media/cdrom/
    # service vsftpd restart

    客户机测试 用户名ftp密码无 目录错误

    解决selinux问题
    # ll /var/ftp/ -dZ
    # ll /media/cdrom/ -dZ //比较两个目录的context的值不相同
    # yum install setroub* //安装selinux 解决监控文件
    # /etc/init.d/auditd restart //启动服务
    # tailf /var/log/messages //查看日志
    客户机测试 再次登录ftp
    sealert -l 1542c587-46c2-41f2-a0a7-ce5adf34297d
    setsebool -P allow_ftpd_full_access 1
    客户机测试 成功登录ftp
    # vim /etc/yum.repos.d/dvd.repo
    [DVD]
    name=RHEL6.5
    baseurl=ftp://192.168.56.200
    enabled=1
    gpgcheck=0
    # yum install tftp-server
    # vim /etc/xinetd.d/tftp
    service tftp
    {
    socket_type = dgram
    protocol = udp
    wait = yes
    user = root
    server = /usr/sbin/in.tftpd
    server_args = -s /var/lib/tftpboot
    disable = no
    per_source = 11
    cps = 100 2
    flags = IPv4
    }
    # /etc/init.d/xinetd restart
    客户机测试:
    #touch /var/lib/tftpboot/aa
    # tftp 192.168.56.200
    tftp> get aa
    # cd /media/cdrom/images/pxeboot/
    # cp vmlinuz initrd.img /var/lib/tftpboot/ //拷贝内核及ram文件
    # yum install syslinux //拷贝pxe引导文件
    # cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/

  • 相关阅读:
    转:超级好用的流程图js框架
    流程图插件
    转:介绍几个著名的实用的Java反编译工具,提供下载
    关于 web.config impersonate 帐号模拟
    SQLSERVER 使用 ROLLUP 汇总数据,实现分组统计,总计(合计),小计
    【论文排版工具】——LaTeX的安装及使用(MiKTeX+TexStudio+Windows)
    C语言输入带空格的字符串
    SQL-连接查询:left join,right join,inner join,full join之间的区别
    MySQL与Oracle的隔离级别
    区块链节点运维相关
  • 原文地址:https://www.cnblogs.com/luoyan01/p/9733672.html
Copyright © 2011-2022 走看看