因为在调试Linxu时须要使用网络来进行下载内核,平时使用的是在Windows下采用tftp软件来完成此操做,可是当调试内核是须要经 常的来修改内核来进行调试,因此要常常的从Linux下拷贝内核到Windows下,很是麻烦,因而想在Linux下配置tftp服务来进行直接下载。从 从网上找了很久,找了一个比较好的文章并试了一下,结果满意。ubuntu
个人ubuntu 是10.10版本vim
一、首先要打开root权限的终端。服务器
#sudo -i网络
Ubuntu 的 10.XX以上,已经能够找到root的终端,若是没有,可使用普通的终端使用sudo命令前缀。tcp
二、下载并安装tftp服务器。ide
通常网上的教程都要下三个文件,一个是tftp,一个是tftpd ,一个是openBSD-inetd。其实大部分的使用采用tftpd和openBSD-inetd就够了。不过为了统一和傻瓜性,仍是用你们都喜欢用的命令。连接网线后,在终端输入。测试
sudo apt-get install tftpd tftp openbsd-inetd字体
按照提示确认并完成ui
三、从新启动系统。this
四、打开终端,编辑配置文件/etc/inetd.conf
建议采用命令:sudo vim /etc/inetd.conf
在这个配置文件里面找到下面的位置:
#:BOOT: TFTP service is provided primarily for booting. Most sites
# run this only on machines acting as "boot servers."
#tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /srv/tftp
#我把上面的默认的配置文件用井号注释掉了,本身配置了下面的一行
#tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot
保存文件退出。
红色字体/tftpboot是我设置的tftp服务的目录
五、建立TFTP服务器的文件目录。
打开终端,进入根目录(用cd / )(或cd ..)退到顶。
输入命令:
sudu mkdir tftpboot
sudu chmod 777 /tftpboot
若是有须要下载的文件这时能够拷贝进去,也用chmod 777命令把全部权限打开。
六、经过下面命令启动(或重启)xinetd服务
sudo /etc/init.d/openbsd-inetd restart
七、查看69端口是否有打开,使用下面命令
netstat -an | more
打印出的东西中找到以下便可:
udp 0 0 0.0.0.0:69 0.0.0.0:*
八、最好统一一下操做 ,reboot一下系统。
九、系统重启后再使用: sudo /etc/init.d/openbsd-inetd restart 命令 重置一下状态。
十、在本机测试一下:
在/tftp目下新建一个文件,并写入数据:
root@Ubuntu:/tftp# echo tftp test > test.txt
到 home 目录下:
root@Ubuntu:/tftp# cd /home/
root@Ubuntu:/home# tftp 192.168.0.114
tftp> get test.txt
Received 11 bytes in 0.1 seconds
tftp> quit
root@Ubuntu:/home# cat test.txt
tftp test
tftp 后面的192.168.0.114是你的ip地址,能够经过ifconfig查看ip地址,固然以前要设置好ip了,我设置的是静态ip
测试成功,大功告成。