Home‎ > ‎unix/linux‎ > ‎Centos Systems‎ > ‎

tftp on Centos

Add Service: 
yum install tftp-server

Setup rights for the tftpd service: 
/usr/sbin/adduser tftpd
mkdir /home/tftpd/tftpboot
chown tftpd:tftpd /home/tftpd/tftpboot/
rmdir /tftpboot

Add acl for IPTables: (this will ensure that tftp over udp:69 is open on the box)
/sbin/iptables -I INPUT -p udp --dport 69 -j ACCEPT
/sbin/service iptables save
/sbin/service iptables restart

Make sure that tftpd starts on boot: 
/sbin/chkconfig xinetd on

Fix the startup (xinetd) script: 
vim /etc/xinetd.d/tftp
Enable the service by changing "disable", set the user to tftp with the "-u" option, make all files R/W by user/group with -U 117, and set the path for the tftp directory with the "-s" flag.  Note that with this config, you can not upload new files, only write over current files.  If you want to add new files use the "-c" arg. 
     server_args             = -u tftpd -U 117 -s /home/tftpd/tftpboot
     disable                 = no

Then startup the tftpd service: 
/sbin/service xinetd start