【教程】ubuntu中配置tftp

简介:

Preface


   今天在 Ubuntu 12.04LTS下配置 tftp时走了些弯路,囧,记录下



下面的方案怎么也工作不起来


   1.安装tftpd(tftp服务器)、tftp(tftp客户端)以及xinetd(超级服务器)

1
#sudo apt-get install tftpd tftp xinetd


   2.建立配置文件,创建/etc/xinetd.d/tftp文件,并在文件中添加如下内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
mystery@lcw: /etc/xinetd .d$  sudo  vim tftp
   1 service tftp                                                           
   2 {
   3         disable = no
   4         socket_type = dgram
   5         protocol = udp
   6         wait =  yes
   7         user = mystery
   8         server = /usr/sbin/in .tftp
   9         server_args = -s  /home/mystery/tftp
  10          source  = 11
  11         cps = 100 2
  12         flags = IPv4
  13 }


   3.建立配置文件,创建/etc/xinetd.d/tftp文件,并更改权限

1
2
3
4
mystery@lcw:~$  sudo  mkdir  /home/mystery/tftp
mystery@lcw:~$  sudo  chmod  -R 777  /home/mystery/tftp
mystery@lcw:~$  sudo  chown  -R mystery  /home/mystery/tftp
mystery@lcw:~$


    4. 通过xinetd超级服务器启动tftpd

      在这之前,先重启下进程

1
mystery@lcw: /etc sudo  reload xinetd

      然后重启服务

1
2
3
4
mystery@lcw: /etc/default sudo  service xinetd restart
xinetd stop /waiting
xinetd start /running , process 3350
mystery@lcw: /etc/default $


   5. 测试

1
2
3
4
5
6
tftp> status
Connected to 192.168.123.24.
Mode: netascii Verbose: off Tracing: off
Rexmt-interval: 5 seconds, Max-timeout: 25 seconds
tftp> get  test
Transfer timed out.

   出现 Transfer timed out


   然后就是怎么测试都不成功!



正确的配置方法


   1、安装:tftp-hpa,tftpd-hpa,xinetd

1
mystery@lcw: sudo  apt-get  install  tftp-hpa tftpd-hpa xinetd


   2、配置/etc/default/tftpd-hpa

1
2
3
4
5
6
# /etc/default/tftpd-hpa
2
3 TFTP_USERNAME= "tftp"
4 TFTP_DIRECTORY= "/home/mystery/tftp"
5 TFTP_ADDRESS= "0.0.0.0:69"
6 TFTP_OPTIONS= "--secure -c"

   说明:第二项改成你自己定义的tftp工作目录路径;第四项添加一个“-s”参数以便运行执行put操作(--secure等同于-s; -c等同与--create)


   3、设置工作目录/home/mystery/tftp权限

1
2
3
mystery@lcw:~$  sudo  chmod  -R 777  /home/mystery/tftp
mystery@lcw:~$  sudo  chown  -R mystery  /home/mystery/tftp
mystery@lcw:~$


   4、重新启动服务

1
2
3
mystery@lcw:~$  sudo  service tftpd-hpa restart
tftpd-hpa stop /waiting
tftpd-hpa start /running , process 5540


   5、通过tftp的get和put进行测试

1
2
3
4
5
6
7
mystery@lcw:~$ tftp localhost
tftp> get  test
tftp> put minicom.log
tftp> q
mystery@lcw:~$  ls  /home/mystery/tftp/
minicom.log   test
mystery@lcw:~$

   OK,TFTP又开始正常工作,囧……




本文转自infohacker 51CTO博客,原文链接:http://blog.51cto.com/liucw/1223695

相关文章
在 Ubuntu 20.04 上安装和配置 Redis
在 Ubuntu 20.04 上安装和配置 Redis 的步骤如下:首先更新系统包,然后通过 `apt` 安装 Redis。安装后,启用并启动 Redis 服务,检查其运行状态。可选配置包括修改绑定 IP、端口等,并确保防火墙设置允许外部访问。最后,使用 `redis-cli` 测试 Redis 功能,如设置和获取键值对。
23 1
Ubuntu安装homebrew的完整教程
本文介绍了如何在没有公网的情况下安装 Homebrew。首先访问 Homebrew 官网,然后通过阿里云的镜像克隆安装脚本,并创建普通用户进行安装。接着修改 `install.sh` 文件指向国内镜像,执行安装命令。最后配置环境变量并更换 Homebrew 源为国内镜像,确保安装顺利。
957 50
ubuntu/debian shell 脚本自动配置 gitea git 仓库
这是一个自动配置 Gitea Git 仓库的 Shell 脚本,支持 Ubuntu 20+ 和 Debian 12+ 系统。脚本会创建必要的目录、下载并安装 Gitea,创建 Gitea 用户和服务,确保 Gitea 在系统启动时自动运行。用户可以选择从官方或小绿叶技术博客下载安装包。
162 2
大数据-54 Kafka 安装配置 环境变量配置 启动服务 Ubuntu配置 ZooKeeper
大数据-54 Kafka 安装配置 环境变量配置 启动服务 Ubuntu配置 ZooKeeper
174 3
大数据-54 Kafka 安装配置 环境变量配置 启动服务 Ubuntu配置 ZooKeeper
Ubuntu22.04静态ip配置+yarn build后显示内存超限,变异失败
Ubuntu22.04静态ip配置+yarn build后显示内存超限,变异失败
70 2
Ubuntu22.04静态ip配置+yarn build后显示内存超限,变异失败
Linux/Ubuntu下使用VS Code配置C/C++项目环境调用OpenCV
通过以上步骤,您已经成功在Ubuntu系统下的VS Code中配置了C/C++项目环境,并能够调用OpenCV库进行开发。请确保每一步都按照您的系统实际情况进行适当调整。
1146 3
在Ubuntu系统上安装与配置Prometheus的步骤
通过以上步骤,您应该已经成功在Ubuntu系统上安装并配置了Prometheus。您现在可以开始使用Prometheus收集和分析您的系统和应用程序的指标数据了。
411 1
liunx各大发行版(centos,rocky,ubuntu,国产麒麟kylinos)网卡配置和包管理方面的区别
liunx各大发行版(centos,rocky,ubuntu,国产麒麟kylinos)网卡配置和包管理方面的区别
225 0
Oracle VM VirtualBox之Ubuntu 22.04LTS双网卡网络模式配置
这篇文章是关于如何在Oracle VM VirtualBox中配置Ubuntu 22.04LTS虚拟机双网卡网络模式的详细指南,包括VirtualBox网络概述、双网卡网络模式的配置步骤以及Ubuntu系统网络配置。
648 3
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等