Fedora之tftp服务器的安装与使用

来源:互联网 发布:通用电气公司人事知乎 编辑:程序博客网 时间:2024/05/21 09:10
1.下载tftp服务器、客户端tftp和守护进程xinetd三个包
dnf install xinetd tftp tftp-server

2.配置vi /etc/xinetd.d/tftp
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /opt/tftpboot -c
per_source = 11
cps = 100 2
flags = IPv4
}

3. 在opt目录下创建tftpboot目录
cd /opt
mkdir tftpboot

4.将tftpboot权限改到最大化。
chmod 777 /opt/tftpboot

5.永久关闭SELinux

编辑/etc/selinux/config,找到SELINUX 行修改成为:SELINUX=disabled:


6. systemctl disable firewalld.service
永久关闭防火墙。

7.systemctl restart xinetd
重启xinetd,相当于是打开tftp服务器。为了保险再执行一句systemctl enable xinetd。

8.本地测试tftp
$tftp 127.0.0.1
tftp>put file             //将当前目录的file上传到/opt/tftpboot下
tftp>get file //从/opt/tftpboot目录下载file文件到当前目录
也可直接使用以下命令
tftp_client上传文件到服务器:$tftp -p -r file ip
tftp_client从服务器下载文件:$tftp -g ip -r file
0 0
原创粉丝点击