Linux系统怎么架设共享文件服务器

Linux系统怎么架设共享文件服务器,第1张

方法/步骤

1,检查linux是否已安装samba;

检查命令为:rpm –qa |grep samba

如果没有输出什么信息,表明没有安装,需要到百度下载安装.

2,建立共享文件夹,命令如下:

mkdir /home/fileshare

设置好文件夹权限,命令如下:

Chmod 755 fileshare

建立samba用户;

groupadd fileshare

useradd –s /sbin/nologin file

smbpasswd –a file

注意:访问共享的用户必须为samba用户,不能使用其他用户;

修改sambe配置文件;命令如下:

vim /etc/samba/smb.conf

修改samba配置文件全局设置;

#==============================Global settings===============

[global] workgroup = WORKGROUP server string = Samba Server security = share

设置文件夹共享,如下:

[sharefile] path = /home/sharefile public = yes read only = yes

重启smb服务;

systemctl start smb

这样就可以了

3、安装samba服务

[root@localhost /]# yum install samba -y

4、创建共享用户

[root@localhost /]# smbpasswd -a smb

[root@localhost /]# smbpasswd -a smb

5、修改配置文件

[root@localhost /]# vim /etc/samba/smb.conf

workgroup = WORKGROUP//Win需要修改为工作组

server string = Samba Server Version %v

security = user //可以改为everyone

passdb backend = tdbsam

[test]

path = /test

public = yes

writeable = yes

valid users = smb

[share]

path = /share

public = yes

writeable = yes

valid users = smb

6、创建本地共享目录和文件权限

[root@localhost /]# mkdir /test /share

[root@localhost /]# chown -R smb.smb /test/ /share/

[root@localhost test]# touch tp1 tp2

[root@localhost test]# chmod 444 tp1

[root@localhost test]# chmod 666 tp2

[root@localhost test]# echo "111" >/test/tp1//ceshi 文本

[root@localhost test]# echo "222" >/test/tp2

[root@localhost test]# service smb restart//开启服务 测试


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/8999292.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-23
下一篇 2023-04-23

发表评论

登录后才能评论

评论列表(0条)

保存