安裝 tftp server
apt install tftpd-hpa
安裝 tftp client
apt install tftp
編輯設定檔
vi /etc/default/tftpd-hpa
# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--secure"
調整tftp 資料匣權限
chown -R tftp:tftp /srv/tftp
測試下載
tftp 192.1681.1.1
tftp> get 234.txt
Received 5 bytes in 0.0 seconds
測試上傳
tftp> put 123.txt
Error code 1: File not found
解決方式:
touch /srv/tftp/123.txt ; chown tftp:tftp /srv/tftp/123.txt
再次測試上傳
tftp> put 123.txt
Error code 2: File must have global write permissions
解決方式:
chmod o+w /srv/tftp/123.txt
再次測試上傳
tftp> put 123.txt
Sent 9 bytes in 0.0 seconds
成功,但納悶 123.txt 的owner 和 tftp 的身分都一樣,為什麼沒權限上傳,沒時間研究,先醬
文章標籤
全站熱搜