ubuntu系统升级为11.10后,在tftp服务器总是出现这样那样的问题。网上找了很多,没有找到一个完整的没有错误的。这是我自己经测试完全通过。
1 ctrl+alt+t 进入终端
su root 切换 并装四个文件
sudo apt-get install tftp-hpa
sudo apt-get install tftpd-hpa
sudo apt-get install openbsd-inetd
sudo apt-get install xinetd
2 去建立一个根目录,然后设置对应的访问属性
sudo mkdir /tftpboot
chmod 777 /tftpboot -R
3 更改配置文件
root@ubuntu:/tftpboot# sudo vi /etc/default/tftpd-hpa
TFTP_USERNAME="root"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure -c"
4 启动ftp服务 和测试
root@ubuntu:/home/zk# sudo /etc/init.d/xinetd restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service xinetd restart
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop xinetd ; start xinetd. The restart(8) utility is also available.
xinetd stop/waiting
xinetd start/running, process 4013
root@ubuntu:/home/zk# tftp localhost
tftp> put zk.c
tftp> quit
root@ubuntu:/# cd / tftpboot
root@ubuntu:/tftpboot# ls
zk.c
root@ubuntu:/home/zk# sudo /etc/init.d/xinetd restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service xinetd restart
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop xinetd ; start xinetd. The restart(8) utility is also available.
xinetd stop/waiting
xinetd start/running, process 4013
root@ubuntu:/home/zk# netstat -a|grep tftp
udp 0 0 *:tftp *:*
root@ubuntu:/home/zk# tftp localhost
tftp> put zk.c
tftp> quit
root@ubuntu:/home/zk# cd /
root@ubuntu:/# ls
bin dir hello1.tar initrd.img.old mnt sbin tftpboot vmlinuz
boot dir1 home lib opt selinux tmp vmlinuz.old
cdrom etc host lost+found proc srv usr zk
dev hello1 initrd.img media root sys var
root@ubuntu:/# cd tftpboot/
root@ubuntu:/tftpboot# ls
hello.c zk.c
root@ubuntu:/tftpboot#