Linux 常用工具
YUM
yum init system
create local repo yum
centos 7 init system
FTP
How to Install and Configure vsftpd on CentOS 6
vsftp install on centos 7
Email
aliyun ecs install email
postfix smtp on centos
centos 6 postfix smpt test
GIT
gogs install centos6
git command example
git format markdown
HTTP Web
apache exampe
h5ai web php file server
apache vhosgts code debug
Nginx Web
nginx install from source
nginx set directory autoindex
autoindex with h5ai web
nginx install pugin ngx-fancyindex
proxy internal vhost to web
dynamic and static by nginx
proxy directory second by nginx
nginx proxy gogs web
jenkns proxy from nginx
ssl certify by nginx
nginx threads fix to 9x
NTP
linux install ntp use asia date
VNC
vnc remote desktop
x11vnc on centos6
Firewall
iptables on centos 7
centos7 firewalld config
Kernel
centos kernel packages
kernel update to 3.10 on centos 6
SYSCTL 内核配置参数分析
NFS
centos6 install nfs servers
mount nfs to linux
mount nfs on centos 6
centos6 nfs verify permissions
SSH
ssh keygen rsa to client
ssh config diffent
Network
centos 7 config net-tool debug ifconfig
debug network card up or down
Samba
samba install on centos 6
samba config example
VIM
VIM using example
本文档使用 MrDoc 发布
-
+
首页
centos6 install nfs servers
# install nfs on centos 6 --- CentOS 6 64bit系统上设置NFS的过程,简单记录一下。 ## 一、部署服务端 1、安装软件包 # yum install nfs-utils tree -y 2、准备好需要共享给别的目录和文件 # mkdir -p /share/{public,private} # mkdir /share/private/protected cp /etc/hosts /share/public/ cp /etc/fstab /share/private/ cp /etc/inittab /share/private/protected/ 最终结果: # tree /share/ ```commandline #/share/ ├── private │ ├── fstab │ └── protected │ └── inittab └── public └── hosts ``` # useradd tester # useradd bobby # id tom * uid=500(tester) gid=500(tester) 组=500(tester) # id mary * uid=501(bobby) gid=501(bobby) 组=501(bobby) # chmod 777 /share/public/ # chown tester:tester -R /share/private/protected/ 计划: - /share/public/ 任何人都可以读写访问 - /share/private/ 来自10.81.0.0/16网络用户可以访问只读 - /share/private/protected/ 只有tester(uid=500)读写 3、编辑nfs共享导出文件 # vim /etc/exports ```bash /share/public *(rw) /share/private 172.16.0.0/16(rw) ``` 注意: 任何的网络服务涉及到数据读写,都是至少两个层次控制 + 首先是 服务 本身的访问控制 + 然后是 系统本上的文件访问控制 4、启动服务 # service rpcidmapd start # service rpcbind start # <---nfs客户端和服务端都依赖该服务 # service nfs start # chkconfig nfs on # 开机就启动服务 # chkconfig rpcbind on # 开机就启动服务 # chkconfig rpcidmapd on # 开机就启动服务 5、查看本机导出的共享 # exportfs * /share/private 10.81.0.0/16 * /share/public <world> 如果修改了/etc/exports文件,可以直接执行以下命令刷新共享 # exportfs -r ## 二、客户端测试 客户端为了保证能够正确使用nfs资源,也应该启动 # service rpcbind start # service rpcidmapd start # chkconfig rpcbind on # 开机就启动服务 # chkconfig rpcidmapd on # 开机就启动服务 查看目标IP机器是否存在nfs共享资源 # showmount -e 10.81.234.47 Export list for 10.81.234.47: /share/public * /share/private 10.81.0.0/16/16(rw) 手工挂载访问 # mkdir /mnt/{public,private} # mount 10.81.234.47:/share/public /mnt/public/ # mount -o soft,intr 10.81.234.47:/share/private /mnt/private/ soft 代表当网络不好,客户端访问超时,客户端的操作会等待默认60秒,如果还没有得到服务端的回应,那么操作就会中断,不会让进程进入到D状态 intr 客户端访问操作超时等待过程中,可以接受信号(-9,-15等)去结束操作。 # df -h … 10.81.234.47:/share/public 9.7G 2.2G 7.0G 24% /mnt/public 10.81.234.47:/share/private 9.7G 2.2G 7.0G 24% /mnt/private # tree /mnt # 看到的结果和nfs服务端的文件列表一样 ```python * /mnt * ├── private * │ ├── fstab * │ └── protected * │ └── inittab * └── public * └── hosts ``` Over
Bobby
2021年12月20日 23:43
分享文档
收藏文档
阅读
101
上一篇
下一篇
微信扫一扫
复制链接
手机扫一扫进行分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码