use*_*141 7 server permissions tftp
我有一个 52 u 机架,带有多个 cisco 交换机和路由器。我还有一个安装了 kvm 的 ubuntu 服务器。我创建了一个安装了 ubuntu 12.04 的虚拟机,用作 tftp 服务器在它和我的网络设备之间传输图像。我根据本网站和其他网站上的各种指南在其上安装了 tftp-hpa、tftpd-hpa 和 xinetd。
在经历了很多痛苦和挫折之后,我能够在主机和我的 Windows 机器上本地进行 tftp。问题是我必须使用以下命令为 /var/lib/tftpboot 目录中的“nobody”用户下的每个要上传到服务器的文件创建空文件:
sudo -u nobody sh <<< "cd /var/lib/tftpboot; touch filename; chmod 777 filename"
Run Code Online (Sandbox Code Playgroud)
BOTTOM LINE UP FRONT:我只想能够“tftp put”我想要的任何文件,而不必先使用上面的命令来创建一个文件。在我开始破坏昂贵的东西之前,请帮助我!这是我的 xinetd.d tftp 配置:
service tftp
{
disable = no
socket_type = dgram
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -v -s /var/lib/tftpboot
}
Run Code Online (Sandbox Code Playgroud)
--create, -c
Allow new files to be created. By default, tftpd will only
allow upload of files that already exist. Files are created
with default permissions allowing anyone to read or write them,
unless the --permissive or --umask options are specified.
Run Code Online (Sandbox Code Playgroud)
更改server_args为:
server_args = -c -v -s /var/lib/tftpboot
Run Code Online (Sandbox Code Playgroud)
您不需要 xinetd 来启动和运行 tftpd。这是我安装和配置 tftpd 的方式:
sudo aptitude install tftpd-hpa
sudo chown -R tftp /var/lib/tftpboot
Run Code Online (Sandbox Code Playgroud)
编辑 /etc/default/tftpd-hpa 以插入-c到TFTP_OPTIONS. 该行应如下所示:
TFTP_OPTIONS="--secure -c"
Run Code Online (Sandbox Code Playgroud)
最后,重启 tftpd 服务:
sudo service tftpd-hpa restart
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
56415 次 |
| 最近记录: |