正规手表回收网站,wordpress 数据备份,福州做彩票app网站,三星网上商城怎么查物流公司内部需要文件共享#xff0c;自建samba服务#xff0c;满足功能 在搭建过程中#xff0c;踩了一些坑#xff0c;如windows无法访问、macos无法访问、账号添加、权限控制 分享一下实现过程#xff0c;内容不详细的地方#xff0c;可评论或私聊
前置准备
服务器 阿里…公司内部需要文件共享自建samba服务满足功能 在搭建过程中踩了一些坑如windows无法访问、macos无法访问、账号添加、权限控制 分享一下实现过程内容不详细的地方可评论或私聊
前置准备
服务器 阿里云/centos7.9 客户端 windows10、windows11、macos、centos 工具 samba samba-client
yum -y install samba samba-client搭建samba服务
服务配置 vim /etc/samba/smb.conf
[global]workgroup SAMBAsecurity userpassdb backend tdbsamprinting cupsprintcap name cupsload printers yescups options rawmap to guest Bad Userpassdb backend tdbsamsmb ports 6727[homes]comment Home Directoriesvalid users %S, %D%w%Sbrowseable Noread only Noinherit acls Yes[printers]comment All Printerspath /var/tmpprintable Yescreate mask 0600browseable No[print$]comment Printer Driverspath /var/lib/samba/driverswrite list printadmin rootforce group printadmincreate mask 0664directory mask 0775
[share]path /opt/abcpublic nobrowseable yeswritable yescreate mask 0777directory mask 0777valid users tom,bobo添加用户
adduser tom
smbpasswd -a tom启动服务
# 启动
systemctl start smb
# 停止
systemctl stop smb
# 重启
systemctl restart smb根据配置 smb ports 6727需要服务器开放6727端口 为什么修改smb默认445端口可参考 https://www.jianshu.com/p/6658e3b5a74a
windows连接
连接配置
使用管理员权限运行cmd 执行以下命令
# 关闭LanmanServer服务
sc config LanmanServer startdisabled
net stop LanmanServer
# 启动ip helper服务用于接口转发
sc config iphlpsvc startauto
# 设置端口转发
netsh interface portproxy add v4tov4 listenport445 connectaddressxxx.xx.xx.xx connectport6727查看转发的端口 netsh interface portproxy show v4tov4 显示如下说明成功 全部执行完成后重启电脑
使用
输入\127.0.0.1\share访问 另外一种方式
macos
打开访达
centos
命令连接 smbclient //xxx.xx.xx.xx/share -p6727 -U username
有使用问题可评论或私聊
参考资料
windows如何访问公网samba samba安装和配置