From 3fe1018adb9ee6e3396a3de67d36066aaa3b2451 Mon Sep 17 00:00:00 2001 From: "rick.chan" Date: Thu, 26 Aug 2021 11:40:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=AD=A3=E6=96=87=E5=86=85?= =?UTF-8?q?=E5=AE=B9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: rick.chan --- .../Samba/Linux_搭建_Samba_服务器.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Software/Applications/Samba/Linux_搭建_Samba_服务器.md b/Software/Applications/Samba/Linux_搭建_Samba_服务器.md index 52c5aca..5d74292 100644 --- a/Software/Applications/Samba/Linux_搭建_Samba_服务器.md +++ b/Software/Applications/Samba/Linux_搭建_Samba_服务器.md @@ -9,7 +9,7 @@ smbd 的运行依赖于 /etc/samba/smb.conf 配置文件,这个是 smbd 的默 SELinux 开启的状态下会影响其他系统对 Samba 服务器的访问,可能造成 Windows 或 Android 系统的 Samba 客户端无法访问服务器(错误提示内容类似于没有授权之类),可以关闭 SELinux 或正确设置 SELinux。临时关闭 SELinux 的方法如下: ```bash -setenforce 0 +sudo setenforce 0 ``` 此时查看 SeLinux 状态 @@ -40,7 +40,7 @@ SELINUXTYPE=targeted ```bash # Ubuntu -apt-get install samba samba-common +sudo apt-get install samba samba-common # Manjaro sudo pacman -S samba ``` @@ -71,9 +71,10 @@ sync always = yes 在 shell 中输入如下命令为 samba 服务分配账户和密码 ```bash +# 必须是已存在的 Linux 用户 sudo smbpasswd -a # 然后按提示输入密码并确认 -# 必须是已存在的 Linux 用户 +# 使能用户 sudo smbpasswd -e ``` @@ -93,17 +94,17 @@ pdbedit -L ```bash # Manjaro -systemctl enable smb.service -systemctl start smb.service +sudo systemctl enable smb.service +sudo systemctl start smb.service # Ubuntu -systemctl enable smbd.service -systemctl start smbd.service +sudo systemctl enable smbd.service +sudo systemctl start smbd.service ``` 必要时需关闭防火墙,或设置防火墙规则。如果修改了 samba 配置信息,则需要重启 samba 服务: ```bash -systemctl restart smb.service +sudo systemctl restart smb.service ``` ## 6. 远程访问