ubuntu安装tftp服务器
1.安装包
sudo apt-get install tftp-hpa tftpd-hpa (前者客户程序,后者服务程序)
sudo apt-get install openbsd-inetd
sudo apt-get install xinetd
2.建tftp共享目录
mkdir ~/tftpboot
3.sudo vim /etc/default/tftpd-hpa
修改TFTP_DIRECTORY="~/tftpboot"
4.sudo /etc/init.d/tftpd-hpa restart
5.本机测试
在tftpboot目录下建a.txt文件,写入数据
cd /home/user
tftp 192.168.1.12本机ip地址 或者tftp 127.0.0.1
tftp>get a.txt
ubuntu安装nfs服务器
1.sudo apt-get install nfs-kernel-server
2.配置挂载目录和权限
sudo vim /etc/exports
/home/xiaoyi *(rw,sync,no_subtree_check)或者 *表示所有用户
/home/user 192.168.1.0/24(rw,sync,no_root_squash) 固定ip地址用户
其中:/home 是要共享的目录,192.168.1.0/24 代表允许访问的网段,
rw 是可读写权限, sync 是资料同步写入内存和硬盘,
no_root_squash 是Ubuntu nfs 客户端分享目录使用者的权限,
如果客户端使用的是root 用户,那么对于该共享目录而言,该客户端就具有root 权限
3.重启服务
sudo /etc/init.d/nfs-kernel-server restart
4.测试Ubuntu nfs
sudo mount localhost:/home/will/rootfs /mnt
sudo mount -t nfs 192.168.1.100:/home /mnt
df命令查看是否挂载成功
可以运行以下命令来显示一下共享出来的目录:
$showmount -e localhost
sudo umount /mnt 卸载
1.安装包
sudo apt-get install tftp-hpa tftpd-hpa (前者客户程序,后者服务程序)
sudo apt-get install openbsd-inetd
sudo apt-get install xinetd
2.建tftp共享目录
mkdir ~/tftpboot
3.sudo vim /etc/default/tftpd-hpa
修改TFTP_DIRECTORY="~/tftpboot"
4.sudo /etc/init.d/tftpd-hpa restart
5.本机测试
在tftpboot目录下建a.txt文件,写入数据
cd /home/user
tftp 192.168.1.12本机ip地址 或者tftp 127.0.0.1
tftp>get a.txt
tftp>quit
6.开发板测试
tftp -g -r a.txt 192.168.1.10
ubuntu安装nfs服务器
1.sudo apt-get install nfs-kernel-server
2.配置挂载目录和权限
sudo vim /etc/exports
/home/xiaoyi *(rw,sync,no_subtree_check)或者 *表示所有用户
/home/user 192.168.1.0/24(rw,sync,no_root_squash) 固定ip地址用户
其中:/home 是要共享的目录,192.168.1.0/24 代表允许访问的网段,
rw 是可读写权限, sync 是资料同步写入内存和硬盘,
no_root_squash 是Ubuntu nfs 客户端分享目录使用者的权限,
如果客户端使用的是root 用户,那么对于该共享目录而言,该客户端就具有root 权限
3.重启服务
sudo /etc/init.d/nfs-kernel-server restart
4.测试Ubuntu nfs
sudo mount localhost:/home/will/rootfs /mnt
sudo mount -t nfs 192.168.1.100:/home /mnt
df命令查看是否挂载成功
可以运行以下命令来显示一下共享出来的目录:
$showmount -e localhost
sudo umount /mnt 卸载