tftp服务器离线安装
获取离线安装包
可以通过去网上下载tftp-server和xinetd得到rpm安装包,也可以通过已有的CentOs系统来获取。
这里使用的是通过已有CentOs系统来获取rpm包。
修改yum的配置文件/etc/yum.conf
,内容如下
[main]
# 缓存路径
cachedir=/var/cache/yum/$basearch/$releasever
# 原始值为0表示安装完后删除包,1表示下载之后不删除,这里我们将其改为1
keepcache=1
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
# This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
# It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
重新加载yum
yum clean all
yum makecache
然后通过yum去下载tftp-server和xinted,下载完成之后在系统的对应目录就可以找到rpm包了,以我的系统为例子,我是CentOs7 X86的,因此我的目录就是/var/cache/yum/x86_64/7/base/packages
,进入到该目录就可以看到对应的rpm包了
yum install -y tftp-server
yum install -y xinted
安装tptp-server
将已经获取到的rpm包,取出放到需要离线安装的服务器,进行离线安装
yum localinstall -y tftp-server
yum localinstall -y xinetd
安装好之后,配置xinetd的开机自启动
systemctl enable xinetd.service
覆盖或修改tftp的配置文件/etc/xinetd.d/tftp
,内容如下
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
# disable 控制tftp服务器的关闭和启动,默认值为“yes”,即关闭tftp服务器,这里修改为“no”,即开启tftp服务器
# server_args tftp文件夹
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /home/data/tftp_data -c
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
重启xinetd是之生效
systemctl restart xinetd.service
设置SeLinux为permissive模式
setenforce 0
可以使用getenforce
命令查看SeLinux状态;并替换配置文件 /etc/sysconfig/selinux
使其重启之后依旧生效,配置文件内容如下
# 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=permissive
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
还没有评论,来说两句吧...