Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1790087
  • 博文数量: 297
  • 博客积分: 285
  • 博客等级: 二等列兵
  • 技术积分: 3006
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-06 22:04
个人简介

Linuxer, ex IBMer. GNU https://hmchzb19.github.io/

文章分类

全部博文(297)

文章存档

2020年(11)

2019年(15)

2018年(43)

2017年(79)

2016年(79)

2015年(58)

2014年(1)

2013年(8)

2012年(3)

分类: LINUX

2015-09-08 10:04:22


1. 首先是安装xinetd 和tftp server.

点击(此处)折叠或打开

  1. /root/ibm-yum.sh install tftp-server

2. 然后修改xinetd 的配置,tftp的配置文件是/etc/xinetd.d/tftp
需要把disable 修改成no.

点击(此处)折叠或打开

  1. cat /etc/xinetd.d/tftp
  2. # default: off
  3. # description: The tftp server serves files using the trivial file transfer \
  4. # protocol. The tftp protocol is often used to boot diskless \
  5. # workstations, download configuration files to network-aware printers, \
  6. # and to start the installation process for some operating systems.
  7. service tftp
  8. {
  9.     socket_type = dgram
  10.     protocol = udp
  11.     wait = yes
  12.     user = root
  13.     server = /usr/sbin/in.tftpd
  14.     server_args = -s /var/lib/tftpboot
  15.     disable = no
  16.     per_source = 11
  17.     cps = 100 2
  18.     flags = IPv4
  19. }
  20. server_args = -s /var/lib/tftpboot 意思是tftp的目录是/var/lib/tftpboot
  21. 我在下面创建了一个文件。
  22. echo "hello ,world ">> /var/lib/tftpboot/1.txt
3. 启动xinetd

点击(此处)折叠或打开

  1. systemctl start xinetd
4. 查看69端口已经被监听了。

点击(此处)折叠或打开

  1. netstat -tunlp |grep 69
  2. tcp6 0 0 :::6988 :::* LISTEN 1681/cimlistener
  3. udp 0 0 0.0.0.0:69 0.0.0.0:* 7901/xinetd
5.  从另外一台电脑登陆上,可以get 1.txt,证实这个tftp server 运行正常了。
6. 另外这是一些xinetd 的选项。
  • disable

    Simply whether or not to run this service. Set it to "no" if you want to activate the service. Note that "enable = yes" doesn't work.

  • socket_type

    Stream, dgram, raw, or seqpacket.

  • wait

    Determines whether or not the service can accept multiple connections. If "yes", xinetd won't accept new connections for this service until the active one exits.

  • user

    The user id for the process. Of course xinetd.d would have to be running as root to start with if you wanted it to be able to run a process as someone else.

  • server

    The actual executable to run. Note this is NOT used to look up port numbers in /etc/services: it's the name of the file itself that is used for that lookup. So if xinetd sees a connection coming in on tcp port 23, it looks in /etc/services, finds that is "telnet", and then looks in the file "telnet" here to determine what to do. Note that there is a "port" attribute (not used here) that can be used if the service doesn't exist in /etc/services, but if it DOES exist, "port" needs to match.

  • groups

    Don't confuse this with "group" (not used here) that would take a group name or id. What this determines is whether or not the service will have access to the supplementary groups that it would otherwise have from its effective id (from "user" above).

  • flags

    There are a number of possible flag settings. Usually you'll see REUSE as above, which is somewhat amusing because that one isn't documented in the man page of some distributions. More amusing is that the reason it isn't documented is that it's a deprecated flag: that is the default now. Reuse lets you accept multiple connections to the same port.

参考:

阅读(1126) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~