redhat7.6 搭建ftp yum服務器


服務器端配置
 
1.關閉防火牆,以及設置開啟不自啟
[root@localhost network-scripts]# systemctl stop firewalld
[root@localhost network-scripts]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
 
2.關閉SELinux
編輯文件/etc/selinux/config,更改為如下,需要重啟生效
[root@localhost network-scripts]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
 
臨時關閉selinux
setenforce 0
 
3.安裝ftp
 
這里為了解決一些依賴包問題直接配置了一下本地yum
vi /etc/yum.repos.d/redhat7.repo
[rhel-source]
name=Source
baseurl=file:///mnt
enabled=1
gpgcheck=0
 
yum clean all
yum install -y vsftpd*
 
4.啟動ftp並設置為開機自啟
systemctl start vsftpd
systemctl enable vsftpd
 
5.創建倉庫,倉庫存放全部的rpm包
mkdir /var/ftp/yum
cp -a /mnt/Packages/* /var/ftp/yum
 
6.生成索引文件
yum install -y createrepo*
 
createrepo /var/ftp/yum
 
客戶端配置
1.配置yum源
[root@bjyctzdb02 yum.repos.d]# vi redhat7.repo
[rhel-source]
name=Red Hat
enabled=1
gpgcheck=0
 
2.清空緩存
yum clean all
 
3.yum安裝測試
 
yum install -y tree*
 
Installed:
  tree.x86_64 0:1.5.3-3.el6                                                                                                                                            
Complete!
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM