在Ubuntu下安装、配置Ubuntu tftp
1.不知道xinetd还是否需要,我的机器上已经装好(apt-get install xinetd),装了也无所谓。
2.sudo apt-get install tftp-hpa
sudo apt-get install tftpd-hpa
3.sudo vim /etc/default/tftpd-hpa, 修改为:
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/home/tftp" // 你的TFTP目录
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="-l -s -c"
4.创建TFTP目录
sudo mkdir -p /home/tftp
sudo chmod -R 777 /home/tftp
5.重启tftp服务
sudo service tftpd-hpa restart
6.测试
sudo cd /home/tftp
sudo echo "test file 1" > file1
cd
tftp localhost
tftp> get file1
tftp> q
查看是否得到了file1
cd
sudo echo "test file 2" > file2
tftp 127.0.0.1
tftp> put file2
tftp> q
sudo cd /home/tftp
查看是否看到file2文件
***************************************************************************************************
***************************************************************************************************
在Ubuntu下安装、配置Ubuntu nfs 1、安装Ubuntu nfs Ubuntu上默认是没有安装Ubuntu nfs服务器的,因此我们首先安装Ubuntu nfs服务器端: $sudo apt-get install nfs-kernel-server 在一些文档中,提出还需要使用apt-get来手动安装nfs的客户端nfs-common,以及端口映射器portmap, 但其实这是没有必要的,因为在安装nfs-kernel-server时,apt会自动为我们把它们安装好。 2、配置/etc/exports Ubuntu nfs允许挂载的目录及权限在文件/etc/exports中进行了定义。 例如,我们要将根目录下的rootfs目录共享出来,那么我们需要在/etc/exports文件末尾添加如下一行: /rootfs *(rw,sync,no_root_squash) 其中:/rootfs是要共享的目录,*代表允许所有的网络段访问,rw是可读写权限,sync是资料同步写入 内存和硬 盘,no_root_squash是Ubuntu nfs客户端分享目录使用者的权限,如果客户端使用的是root用 户,那么对于该共享目录而言,该客户端就具有root权限。 3、Ubuntu nfs重启服务 $sudo /etc/init.d/portmap restart $sudo /etc/init.d/nfs-kernel-server restart 4、测试Ubuntu nfs 此时可以运行以下命令来显示一下共享出来的目录: $showmount -e 或者可以使用以下命令把它挂载在本地磁盘上,例如将/rootfs挂载到/mnt下: $ sudo mount -t nfs localhost:/rootfs /mnt 可以运行df命令查看是否挂载成功。查看后可以使用以下命令卸载: $ sudo umount /mnt |