1、安裝
sudo apt-get install tftp
sudo apt-get install xinetd
2、建立共用目錄
sudo mkdir /tftpboot
3、把共用目錄修改為最大許可權
sudo chmod 777 tftpboot
4、修改設定檔(/etc/inetd.conf)
1、我們看下我們預設的設定檔,設定檔如下
# /etc/inetd.conf: see inetd(8) for further informations.
#
# Internet superserver configuration database
#
#
# Lines starting with "#:LABEL:" or "#<off>#" should not
# be changed unless you know what you are doing!
#
# If you want to disable an entry so it isn't touched during
# package updates just comment it out with a single '#' character.
#
# Packages should modify this file by using update-inetd(8)
#
# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
#
#:INTERNAL: Internal services
#discardstreamtcpnowaitrootinternal
#discarddgramudpwaitrootinternal
#daytimestreamtcpnowaitrootinternal
#timestreamtcpnowaitrootinternal
#:STANDARD: These are standard services.
#:BSD: Shell, login, exec and talk are BSD protocols.
#:MAIL: Mail, news and uucp services.
#:INFO: Info services
#:BOOT: TFTP service is provided primarily for booting. Most sites
# run this only on machines acting as "boot servers."
tftpdgramudpwaitnobody/usr/sbin/tcpd/usr/sbin/in.tftpd /srv/tftp
#:RPC: RPC based services
#:HAM-RADIO: amateur-radio services
#:OTHER: Other services
2、修改設定檔內容(添加我們剛才建立的共用工作資料夾)
把該行tftpdgramudpwaitnobody/usr/sbin/tcpd/usr/sbin/in.tftpd /srv/tftp
改為tftpdgramudpwaitnobody/usr/sbin/tcpd/usr/sbin/in.tftpd /tftpboot
5、啟動tftp伺服器
sudo /etc/init.d/xinetd restart
sudo in.tftpd -l /tftpboot
6、測試
1、在共用資料夾中建立一個檔案
touch test.txt
2、啟動tftp
tftp 192.168.0.148
說明,ip地址是自己的ip地址,查詢方法,ifconfig
3、get test.txt
如果在當前檔案夾看到test.txt則設定成功,否則重新檢查配置