dnsmasq TFTP directory /tftpd inaccessible: Permission denied

本文详细介绍了在 Fedora 21 Server 版本中配置 dnsmasq 作为 TFTP 服务器时遇到的权限问题,包括如何设置目录权限和 SELinux 状态以确保 dnsmasq 正常启动。通过调整 SELinux 设置为临时关闭或永久禁用,成功解决了 TFTP 目录不可访问导致的启动失败问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在fedora21 server版本中配置dnsmasq作为tftp服务器,修改配置文件/etc/dnsmasq.conf,增加如下选项:

enable-tftp
tftp-root=/tftpd

在根目录下创建文件夹tftpd,修改属主为nobody:nobody,然后启动dnsmasq服务器,总是不能启动起来,错误信息如下:

Mar 25 16:54:35 localhost dnsmasq[1787]: TFTP directory /tftpd inaccessible: Permission denied
Mar 25 16:54:35 localhost dnsmasq[1787]: FAILED to start up
Mar 25 16:54:35 localhost systemd: dnsmasq.service: main process exited, code=exited, status=3/NOTIMPLEMENTED
Mar 25 16:54:35 localhost systemd: Unit dnsmasq.service entered failed state.
Mar 25 16:54:35 localhost systemd: dnsmasq.service failed.

刚开始以为是tftpd文件夹的权限问题,就将它设置为777,重启仍然报错,最后思考了下会不会是SELinux所致,默认fedora安装完成后SELINUX的状态为enforcing,关闭SELINUX,重启OK,还真是这个原因!!!建议默认情况下关闭SELinux,方法有两种:

  • 暂时关闭
    setenforce 0
  • 永久关闭
    vim /etc/selinux/config修改enforcing为disable,重启服务器

dnsmasq启动OK的输出:

Mar 25 17:09:12 localhost dnsmasq[2131]: started, version 2.72 cachesize 150
Mar 25 17:09:12 localhost dnsmasq[2131]: compile time options: IPv6 GNU-getopt DBus no-i18n IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth DNSSEC loop-detect
Mar 25 17:09:12 localhost dnsmasq-dhcp[2131]: DHCP, IP range 192.168.0.50 -- 192.168.0.150, lease time 12h
Mar 25 17:09:12 localhost dnsmasq-tftp[2131]: TFTP root is /tftpd
Mar 25 17:09:12 localhost dnsmasq[2131]: reading /etc/resolv.conf
Mar 25 17:09:12 localhost dnsmasq[2131]: read /etc/hosts - 2 addresses
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值