1 安装Samba服务器
安装
sudo apt-get install samba
创建smaba用户并设置密码
sudo smbpasswd -a your-username
配置
# 编辑Samba配置文件 sudo vi /etc/samba/smb.conf # 在配置文件最后添加如下内容 [syh] path = /path/to/your/dir browseable = yes read only = no public = no writable = yes vaild users = your-username
重启samba服务器
sudo /etc/init.d/smbd restart
2 安装tftp服务器
安装
sudo apt-get install tftp-hpa tftpd-hpa
创建tftp根目录
配置tftp
配置/etc/xinetd.conf配置文件,如果没有该文件则创建。
# Simple configuration file for xinetd # # Some defaults, and include /etc/xinetd.d/ defaults { # Please note that you need a log_type line to be able to use log_on_success # and log_on_failure. The default is the following : # log_type = SYSLOG daemon info } includedir /etc/xinetd.d
创建配置文件,/etc/default/tftpd-hpa
TFTP_USERNAME="tftp" TFTP_DIRECTORY="/path/to/your/dir" TFTP_ADDRESS="0.0.0.0:69" TFTP_OPTIONS="-l -c -s"
创建配置文件,/etc/xinetd.d/tftp
service tftp { socket_type = dgram wait = yes disable = no user = root protocol = udp server = /usr/sbin/in.tftpd server_args = -s /path/to/your/dir per_source = 11 cps =100 2 flags =IPv4 }
重启tftp服务
sudo service tftpd-hpa restart
测试
$ tftp localhost //localhost 表示本机 $ tftp>get test.txt //test.txt 是在你的tftp目录创建一个有内容的文件 $ tftp>put test1.txt //test1.txt 是在当前目录下新建的文件 $ tftp>q //退出
3 安装nfs服务器
下载安装
sudo apt-get install nfs-kernel-server nfs-common
配置 /etc/exports, 在文件中添加如下内容:
/path/to/your/dir *(rw,sync,no_subtree_check,no_root_squash)
挂载测试
暂无评论!
登录 来发表评论