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

2025-04-12 10:30:27
推荐回答(1个)
回答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;

这样就可以了