tftp服务器离线安装

淩亂°似流年 2022-11-10 01:24 312阅读 0赞

获取离线安装包

可以通过去网上下载tftp-server和xinetd得到rpm安装包,也可以通过已有的CentOs系统来获取。

这里使用的是通过已有CentOs系统来获取rpm包。

修改yum的配置文件/etc/yum.conf,内容如下

  1. [main]
  2. # 缓存路径
  3. cachedir=/var/cache/yum/$basearch/$releasever
  4. # 原始值为0表示安装完后删除包,1表示下载之后不删除,这里我们将其改为1
  5. keepcache=1
  6. debuglevel=2
  7. logfile=/var/log/yum.log
  8. exactarch=1
  9. obsoletes=1
  10. gpgcheck=1
  11. plugins=1
  12. installonly_limit=5
  13. bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
  14. distroverpkg=centos-release
  15. # This is the default, if you make this bigger yum won't see if the metadata
  16. # is newer on the remote and so you'll "gain" the bandwidth of not having to
  17. # download the new metadata and "pay" for it by yum not having correct
  18. # information.
  19. # It is esp. important, to have correct metadata, for distributions like
  20. # Fedora which don't keep old packages around. If you don't like this checking
  21. # interupting your command line usage, it's much better to have something
  22. # manually check the metadata once an hour (yum-updatesd will do this).
  23. # metadata_expire=90m
  24. # PUT YOUR REPOS HERE OR IN separate files named file.repo
  25. # in /etc/yum.repos.d

重新加载yum

  1. yum clean all
  2. yum makecache

然后通过yum去下载tftp-server和xinted,下载完成之后在系统的对应目录就可以找到rpm包了,以我的系统为例子,我是CentOs7 X86的,因此我的目录就是/var/cache/yum/x86_64/7/base/packages,进入到该目录就可以看到对应的rpm包了

  1. yum install -y tftp-server
  2. yum install -y xinted

安装tptp-server

将已经获取到的rpm包,取出放到需要离线安装的服务器,进行离线安装

  1. yum localinstall -y tftp-server
  2. yum localinstall -y xinetd

安装好之后,配置xinetd的开机自启动

  1. systemctl enable xinetd.service

覆盖或修改tftp的配置文件/etc/xinetd.d/tftp,内容如下

  1. # default: off
  2. # description: The tftp server serves files using the trivial file transfer \
  3. # protocol. The tftp protocol is often used to boot diskless \
  4. # workstations, download configuration files to network-aware printers, \
  5. # and to start the installation process for some operating systems.
  6. # disable 控制tftp服务器的关闭和启动,默认值为“yes”,即关闭tftp服务器,这里修改为“no”,即开启tftp服务器
  7. # server_args tftp文件夹
  8. service tftp
  9. {
  10. socket_type = dgram
  11. protocol = udp
  12. wait = yes
  13. user = root
  14. server = /usr/sbin/in.tftpd
  15. server_args = -s /home/data/tftp_data -c
  16. disable = no
  17. per_source = 11
  18. cps = 100 2
  19. flags = IPv4
  20. }

重启xinetd是之生效

  1. systemctl restart xinetd.service

设置SeLinux为permissive模式

  1. setenforce 0

可以使用getenforce命令查看SeLinux状态;并替换配置文件 /etc/sysconfig/selinux使其重启之后依旧生效,配置文件内容如下

  1. # This file controls the state of SELinux on the system.
  2. # SELINUX= can take one of these three values:
  3. # enforcing - SELinux security policy is enforced.
  4. # permissive - SELinux prints warnings instead of enforcing.
  5. # disabled - No SELinux policy is loaded.
  6. SELINUX=permissive
  7. # SELINUXTYPE= can take one of three two values:
  8. # targeted - Targeted processes are protected,
  9. # minimum - Modification of targeted policy. Only selected processes are protected.
  10. # mls - Multi Level Security protection.
  11. SELINUXTYPE=targeted

发表评论

表情:
评论列表 (有 0 条评论,312人围观)

还没有评论,来说两句吧...

相关阅读