Ubuntu 14.04 下安装 TFTP 艰辛之路【转】
本文转载自:https://blog.csdn.net/donglicaiju76152/article/details/76651210
背景
按说在Linux下安装tftp server 很简单,之前操作过很多次了。这次也是直接从网上搜索,搜出了很多内容。之前都是在Centos下安装的,这次是第一次在Ubuntu下安装,看那些内容有些不太一样,但是大同小异。
失败方案
下面的操作是按照网上来的:
安装软件
apt-get install xinetd tftp tftpd
修改配置文件
vi /etc/xinetd.d/tftp
service tftp                                                                    
{
    protocol        = udp
    port            = 69
    socket_type     = dgram
    wait            = yes
    user            = nobody
    server          = /usr/sbin/in.tftpd
    server_args     = -s /root/tftpboot -c
    disable         = no
} - 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
创建目录
mkdir /root/tftpboot 
chmod 777 /root/tftpboot
启动服务
/etc/init.d/xinetd restart
查看服务
netstat -an | more | grep udp 
udp        0      0 0.0.0.0:69              0.0.0.0:*
测试
tftp 127.0.0.1 
tftp> get hello 
Error code 2: Access violation
此次出现了错误,网上也众说不一。 
最终的解决方案是:vi /etc/inetd.conf 
注释掉下面这句话: 
tftp       dgram   udp wait    nobody  /usr/sbin/tcpd  /usr/sbin/in.tftpd /root/tftpboot
再次测试
Transfer timed out
直接无语,安装个TFTP这么折腾,再次上网搜索,终于发现了一篇文章。他里面给出的结论是上面的操作也是不成功的,接着给出了新的解决方案。
成功方案
安装软件
apt-get install tftp-hpa tftpd-hpa xinetd
修改配置
vi /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/root/tftpboot"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--secure -c"- 1
- 2
- 3
- 4
重启服务
service tftpd-hpa restart
测试
tftp 127.0.0.1 
tftp> get hello 
tftp> quit
成功!
NFS
安装软件
apt-get install nfs-kernel-server
修改配置
vi /etc/exports 
/root/rootfs *(rw,sync,no_root_squash) 
exportfs -a
重启服务
/etc/init.d/rpcbind restart 
/etc/init.d/nfs-kernel-server restart
测试
mount -t nfs 192.168.2.104:/root/rootfs /mnt/
参考
http://liucw.blog.51cto.com/6751239/1223695 
http://jacoxu.com/ubuntu-14-04%E4%B8%8Bnfs%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/ 
https://unix.stackexchange.com/questions/106122/mount-nfs-access-denied-by-server-while-mounting-on-ubuntu-machines
--------------------- 本文来自 donglicaiju76152 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/donglicaiju76152/article/details/76651210?utm_source=copy
 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号