ubuntu 11.04 上安装 tftp server

来源:互联网 发布:淘宝物流助手在哪里 编辑:程序博客网 时间:2024/06/06 08:35

转载:

http://blog.chinaunix.net/uid-488742-id-2419697.html

安装来新的Ubuntu 11.04版本:

root@ubuntu:/etc/init.d# uname -r
2.6.38-8-generic
root@ubuntu:/etc/init.d# uname -a
Linux ubuntu 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux
root@ubuntu:/etc/init.d# cat /etc/issue
Ubuntu 11.04 \n \l
root@ubuntu:/etc/init.d# cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.04
DISTRIB_CODENAME=natty
DISTRIB_DESCRIPTION="Ubuntu 11.04"
 
I have started my trails with TFTP as follows:
 
1. Installed tftpd and related packages.
root@ubuntu: sudo apt-get install xinetd tftpd tftp
2. edit the file entry in /etc/xinetd.d/tftp
service tftp
{
protocol        = udp
port            = 69
socket_type     = dgram
wait            = yes
user            = nobody
server          = /usr/sbin/in.tftpd
server_args     = /tftpboot
disable         = no
}
3. I Made /tftpboot directory
root@ubuntusudo: mkdir -p /tftpboot
root@ubuntusudo: chmod 777 /tftpboot
root@ubuntusudo: chown nobody /tftpboot
4. Stop and Started tftpd through xinetd
root@ubuntu:/etc/init.d# sudo /etc/init.d/xinetd stop
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service xinetd stop
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) utility, e.g. stop xinetd
xinetd stop/waiting
$ sudo /etc/init.d/xinetd start
root@ubuntu:/etc/init.d# sudo /etc/init.d/xinetd start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service xinetd start
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start xinetd
5. Checked the Xinetd & tftp status
root@ubuntu:/etc/init.d# ps -e | grep xinetd
root@ubuntu:/etc/init.d# chkconfig | grep xinetd
tftp                        xinetd
xinetd                      off
root@ubuntu:/etc/init.d# chkconfig | grep tftp
atftpd                      on
tftp                        xinetd

6. 在/tftpboot目录下,创建一个文件,名为:test.

执行 tftp localhost
tftp> get test
tftp> q
albert@albert-virtual-machine:~/src/app_linux/pld_service$ ls
test
测试成功!