dbird 发表于 2012-10-29 15:15:36

飞凌-unix 发表于 2012-10-30 08:56:13

sudo apt-get install tftpd-hpa tftp-hpa
打开/etc/default/tftpd-hpa它的配置文件。
#Defaults for tftpd-hpa
RUN_DAEMON="no"
OPTIONS="-l -s /var/lib/tftpboot"
修改设置如下:
#Defaults for tftpd-hpa
RUN_DAEMON="yes"
OPTIONS="-l -s /home/zdreamx/tftpboot"
其中/home/zdreamx/tftpboot是自己设定的目录,可以根据情况修改。

选项参考
OPTIONS
-l Run the server in standalone (listen) mode, rather than run from
inetd. In listen mode, the -t option is ignored, and the -a
option can be used to specify a specific local address or port
to listen to.

-a [:port]
Specify a specific address and port to listen to when called
with the -l option. The default is to listen to the tftp port
specified in /etc/services on all local addresses.
listen 的 ip address 和 Port
-c Allow new files to be created. By default, tftpd will only
allow upload of files that already exist. Files are created
with default permissions allowing anyone to read or write them,
unless the -p or -U options are specified.

-s (决定tftp根目录)Change root directory on startup. This means the remote host
does not need to pass along the directory as part of the trans-
fer, and may add security. When -s is specified, exactly one
directory should be specified on the command line. The use of
this option is recommended for security as well as compatibility
with some boot ROMs which cannot be easily made to include a
directory name in its request.
重启OK

1、安装相关软件包
apt-get install tftpd      (服务端)
apt-get install tftp      (客户端)
apt-get install xinetd
2、建立配置文件
cd /etc/xinetd.d/
vi tftp
输入
service tftp
{
         socket_type                = dgram
         protocol                   = udp
         wait                     = yes
         user                     = root
         server                     = /usr/sbin/in.tftpd
         server_args                = -s /tftpboot
         disable                  = no
         per_source               = 11
         cps                        = 100 2
         flags                      = IPv4
}
存盘退出
3、建立tftp服务文件目录
      mkdir /tftpboot
4、从新启动服务
      /etc/init.d/xinetd restart
安装完成!测试方法:
在/tftpboot 目录下随便放个文件abc
然后 运行tftp 192.168.123.202 进入tftp命令行
输入get abc 看看是不是能把文件下下来,如果可以就可以了,也可以put 文件上去

阿俊 发表于 2014-3-23 12:04:05

飞凌-unix 发表于 2014-3-24 11:14:29

阿俊 发表于 2014-3-23 12:04 static/image/common/back.gif
sudo apt-get install tftpd-hpa tftp-hpa
Reading package lists... Done
Building dependency tree   ...

您更新一下软件源,然后再下载
页: [1]
查看完整版本: ubuntu TFTP 安装