ubuntu中配置tftp服务

1、安装

sudo apt-get install tftp

sudo apt-get install xinetd

 

2、创建共享目录

sudo mkdir /tftpboot

3、把共享目录修改为最大权限

sudo chmod 777 tftpboot

4、修改配置文件(/etc/inetd.conf)

1、我们看下我们默认的配置文件,配置文件如下

# /etc/inetd.conf:  see inetd(8) for further informations.

#

# Internet superserver configuration database

#

#

# Lines starting with "#:LABEL:" or "#<off>#" should not

# be changed unless you know what you are doing!

#

# If you want to disable an entry so it isn't touched during

# package updates just comment it out with a single '#' character.

#

# Packages should modify this file by using update-inetd(8)

#

# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>

#

#:INTERNAL: Internal services

#discard stream tcp nowait root internal

#discard dgram udp wait root internal

#daytime stream tcp nowait root internal

#time stream tcp nowait root internal

#:STANDARD: These are standard services.

#:BSD: Shell, login, exec and talk are BSD protocols.

#:MAIL: Mail, news and uucp services.

#:INFO: Info services

#: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

#:RPC: RPC based services

#:HAM-RADIO: amateur-radio services

#:OTHER: Other services

 

2、修改配置文件内容(添加我们刚才新建的共享工作文件夹)

把该行 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

5、启动tftp服务器

sudo /etc/init.d/xinetd restart

sudo in.tftpd -l /tftpboot

6、测试

1、在共享文件夹中新建一个文件

touch test.txt

2、启动tftp

tftp 192.168.0.148

说明,ip地址是自己的ip地址,查询方法,ifconfig

3、get test.txt

如果在当前文件夹看到test.txt则设置成功,否则重新检查配置

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值