centos 共享文件目录

Posted on 2018-10-10 17:18  风行天下-2080  阅读(425)  评论(0编辑  收藏  举报
# yum install nfs-utils

# mkdir /storage

# cat /etc/exports
/storage        *(fsid=0,rw,sync,no_root_squash,no_subtree_check,crossmnt)

# service nfs start
______________________________________________

samba 共享目录无法访问 解决方法总结

https://blog.csdn.net/runningsword/article/details/6890159?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control







配置完成后使用命令
showmount -e *.*.3.1 查看共享目录

————————————————————————————————————————————————————————————————————
centos7设置共享文件夹(samba)
https://blog.csdn.net/plychoz/article/details/80737736
(三大共享文件的方法)
https://www.cnblogs.com/andriod-html5/archive/2012/05/07/2539224.html

https://blog.csdn.net/weixin_46545446/article/details/108566730 (smb共享,比较好)

安装并启动samba

[root@Kling ~]# yum -y install samba  #使用yum安装samba
[root@Kling ~]# systemctl start smb nmb #启动 
[root@Kling ~]# systemctl enable smb  #开机自启
[root@Kling ~]# systemctl enable nmb  #开机自启

防火墙放行samba

[root@Kling ~]# firewall-cmd --permanent --add-service=samba #放行samba服务
success
[root@Kling ~]# firewall-cmd --reload #重新加载防火墙
success

4,创建共享目录和用户

[root@Kling /]# mkdir /common  
[root@Kling /]# useradd kouling
[root@Kling /]# smbpasswd -a kouling 

[root@Kling /]# pdbedit -L  #查看samba用户
kouling:1002:

修改配置文件

[common]
        comment = ziliao
        path = /common
        allow hosts =10.1.100.0/24
        writable = yes

语法检查

[root@Kling /]# testparm 
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

设置权限

[root@Kling /]# chown -R 755 /common/

重启服务

[root@Kling common]# systemctl restart smb
[root@Kling common]# systemctl restart nmb
 

Copyright © 2024 风行天下-2080
Powered by .NET 8.0 on Kubernetes