dnsmasq TFTP directory /tftpd inaccessible: Permission denied

来源:互联网 发布:淘宝发布宝贝模版 编辑:程序博客网 时间:2024/06/10 20:53

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

enable-tftptftp-root=/tftpd

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

Mar 25 16:54:35 localhost dnsmasq[1787]: TFTP directory /tftpd inaccessible: Permission deniedMar 25 16:54:35 localhost dnsmasq[1787]: FAILED to start upMar 25 16:54:35 localhost systemd: dnsmasq.service: main process exited, code=exited, status=3/NOTIMPLEMENTEDMar 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 150Mar 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-detectMar 25 17:09:12 localhost dnsmasq-dhcp[2131]: DHCP, IP range 192.168.0.50 -- 192.168.0.150, lease time 12hMar 25 17:09:12 localhost dnsmasq-tftp[2131]: TFTP root is /tftpdMar 25 17:09:12 localhost dnsmasq[2131]: reading /etc/resolv.confMar 25 17:09:12 localhost dnsmasq[2131]: read /etc/hosts - 2 addresses
0 0
原创粉丝点击