通过不同启动方式解决:Error code 2: Only absolute
filenames allowed。
以下在Ubuntu 10.04 或 10.10下测试通过
1、安装Ubuntu tftp服务版和客户端
apt-get install tftpd-hpa tftp-hpa xinetd(我的系统已经xinet默认就有)
2,确认tftpd服务已经启动
status tftpd-hpa
如果没有启动,执行:
service tftpd-hpa
start
或
cd /etc/init.d
./tftpd-hpa start
3, 确认tftp启动方式:
4、新建tftpd主目录
cd /
mkdir -p /tftpboot
chmod 777
tftpboot
cd tftpboot
touch 1.txt
5、修改启动配置文件
启动方式一:xinetd
gedit
/etc/xinetd.d/tftp
service tftp
{
disable = no
socket_type = dgram
wait = no
user = root
protocol = udp
server = /usr/sbin/in.tftpd
server_args =
per_source
cps
flags
}
启动方式二:tftpd-hpa
gedit /etc/default/tftpd-hpa
#Defaults for tftpd-hpa
#Ubuntu 10.04 以前版本用这个(如果是这个,最后4行用#注释或 除)
RUN_DAEMON="yes"
OPTIONS="-l -c -s /tftpboot"
#Ubuntu 10.04 and 以后用这个(如果是这个,之前两行用#注释或 除)
TFTP_USERNAME="tftp"TFTP_DIRECTORY="/tftpboot"TFTP_ADDRESS="0.0.0.0:69"TFTP_OPTIONS="-l -c -s"
6、重新启动服务
如果是启动方式一:执行 /etc/init.d/xinetd restart
如果是启动方式二:执行 service tftpd-hpa restart
7、测试tftpd服务是否成功
tftp
localhost
tftp> get
1.txt
tftp> put
1.txt
tftp>
verbose
Verbose mode on.
tftp>
trace
Packet tracing on.
tftp> put
kkk.log
sent DATA
received ACK
.........
sent DATA
received ACK