TFTP,全名為 Trivial File Transfer Protocol,
通常用於檔案的傳輸,
在嵌入式系統中常用來下載韌體或者檔案,
作為一種更新或者復原的手段
今天就帶大家來看看
Ubuntu 20.04 架設 tftp server
首先當然要安裝相關的套件
sudo apt-get install xinetd tftpd tftp
接著要建立一個設定檔:
位於  /etc/xinetd.d/tftp  內容大概長這樣
service tftp
{
  protocol        = udp
  port            = 69
  socket_type     = dgram
  wait            = yes
  user            = nobody
  server          = /usr/sbin/in.tftpd
  server_args     = /home/yaw/tft_root
  disable         = no
}
要特別注意的是   
server_args 與 user  這兩者會決定檔案存放的資料夾與使用者權限
接著到 home/yaw 這個資料夾中執行底下命令,設定好資料夾與權限
sudo mkdir /tft_root
sudo chmod -R 777 /tft_root
sudo chown -R nobody /tft_root
將服務重新啟動
sudo service xinetd restart
就能夠直接以 
tftp localhost 來進行測試
或者其他檔案的傳輸
例如上面所提到的嵌入式系統的更新或者復原手段
最後附上範例影片,
還沒有訂閱的朋友記得點選影片右下角支持本站頻道

沒有留言:
張貼留言