MacOS Open tftp service

##开启

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
sudo vim /System/Library/LaunchDaemons/tftp.plist
# dd掉两行
<key>Disabled</key> 和 <true/>
# 添加两行(-i 开启不安全模式 -l 记录所有log)
<string>-i</string>
<string>-l</string>

# 加载
launchctl load -F /System/Library/LaunchDaemons/tftp.plist
# 开启
sudo launchctl start com.apple.tftpd

# tail -f /var/log/system.log

### chmod 777
sudo chmod 777 /private/tftpboot

# MacOS12 /System/Library/LaunchDaemons/
mkdir ~/Library/LaunchDaemons/

cp /System/Library/LaunchDaemons/tftp.plist ~/Library/LaunchDaemons/tftp.plist

sudo launchctl start ~/Library/LaunchDaemons/tftp.plist

关闭

1
launchdctl unload -F /System/Library/LaunchDaemons/tftp.plist 

命令选项

注意跟ftp不同,没有ls命令,无法显示所有文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Commands may be abbreviated.  Commands are:

connect connect to remote tftp
mode set file transfer mode
put send file
get receive file
quit exit tftp
verbose toggle verbose mode
blksize set an alternative blocksize (def. 512)
tsize toggle extended tsize option
trace toggle packet tracing
status show current status
binary set mode to octet
ascii set mode to netascii
rexmt set per-packet retransmission timeout
timeout set total retransmission timeout
tout toggle extended timeout option
? print help information