linux 装机宝典之一TFTP安装(server&client)

安装步骤:

(1) yum install tftp  --> 安装tftp client

(2) yum install tftp-server -->安装tftp server

(3) yum install xinetd -->安装tftp的超级服务守护进程

安装完(2)后,在/etc/xinetd.d/下会生产一个tftp.rpmnew的tftp服务配置文件样板,只需修改disable                 = yes为disable                 = no,然后保存退出,重启xinetd:

serveice xinetd restart,让配置生效,当然可以看到setup时,可以看到tftp服务那项是选上的,也就是开机就会启动tftp服务。另外,网上很多(基于Ubuntu的)都说可以改user和

server_arg,但是我尝试更改这两个设置,但是在本地测试时都不能成功。另外,我只测试了从主目录/var/lib/tftpboot/下载文件的功能,而上传会出现:Error code 0: Permission denied的错误。现在,没有找到这个问题的症结。希望有人能够帮我回答。

/etc/xinetd.d/tftp 里面修改 disable=no, 修改tftp默认路径、var/lib/tftpboot

he below steps will allow you to set up a TFTP server on Linux but specifically on a CentOS server. All you need to do is install a couple files with yum, enable the server, and restart xinetd.

    Install TFTP Server: Use the below syntax to install the TFTP server on CentOS.
    1    [root@centos-server ~]#yum install tftp-server

    Install Xinetd: The TFTP server will run via xinetd so you need to make sure xinetd is installed using the bellow command.
    1    [root@centos-server ~]#yum install xinetd
    Enable TFTP and Xinetd: Use chkconfig to ensure that xinetd and tftp starts on reboot.
    1    [root@centos-server ~]#chkconfig tftp on
    2    [root@centos-server ~]#chkconfig xinetd on
    Modify TFTPBOOT Permissions: Use the below syntax to modify the permissions of the /tftpboot directory to allow tftp transfers to and from this directory. The /tftpboot directory is the default directory where files are transfered to and from using TFTP.
    1    [root@centos-server ~]#chmod 777 /tftpboot
    Example TFTP Command: The below is an example of use of the TFTP command.
    1    [root@centos-server ~]#tftp -v 192.168.1.100 -c put file-example.txt

    The normal computer user is probably not going to find TFTP very useful but techies will be able to find many uses. Typically technical people will run across TFTP when upgrading the firmware on some sort of network device. Please post comments if you have any TFTP questions.

2.配置vi /etc/xinetd.d/tftp  修改server_args = -s /tftpboot -c,这里的-c一定要加上,否则只能下载不能上传!!

 怎么测试是否成功呢,安装tftp,tftp-server,xinetd,先检查xinetd和tftp是否on了,chkconfig --list | grep xinetd;

chkconfig --list | grep tftp, 如果都on了说明服务都开了,

tftp 127.0.0.1

>get tmp.c

然后再get/put, 注意如果要put,记得将/etc/xinetd.d/tftp 里面的加上-c。

 

转载于:https://www.cnblogs.com/lcnewstart/p/3183290.html

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值