这里对 Ubuntu 非常陌生,我通过设置 NAS 来学习。
我在使用 Sambashare 时遇到问题,从 Windows 桌面访问 NAS 时,除了根文件夹之外,我失去了每个子文件夹的权限。根本无法在任何子文件夹中写入。但我能够通过以下方式纠正这个问题(似乎是暂时的,但我没有测试太多):
sudo chgrp sambashare /mediaserver/data/directory
但这仅适用于我指定的目录,不适用于任何父/子目录。
我的 SMB 配置如下所示:
[NAS]
path = /mediaserver
guest ok = No
writeable = Yes
create mask = 0777
directory mask = 0777
编辑:
以下是我设置 Samba 的过程:
# Update device:
sudo apt update && sudo apt upgrade -y
# Install Samba
sudo apt-get install samba samba-common-bin
Y
# identify the drive
sudo fdisk -l
# Note the partition ie.: /dev/sda1
# Create directory to share
sudo su
cd /
mkdir mediaserver
ls -l
# Provide user full access to the directory
chmod 777 mediaserver
- Alt + D to exit root mode
# To configure Samba share:
sudo nano /etc/samba/smb.conf
# Insert new section at bottom of conf
[NAS]
path = /mediaserver
writeable = Yes
create mask = 0777
directory mask = 0777
# Restart the Samba daemon after making changes
sudo systemctl restart smbd
# Mount ext drive to the share directory
sudo mount -t auto /dev/sda1 /mediaserver
# Enable ext drive to be auto mounted whenever system reboots
sudo nano /etc/fstab
# Add the following line:
/dev/sda1 /mediaserver auto noatime 0 0
# Set group ownership of mediaserver directory to sambashare group
sudo chgrp sambashare /mediaserver
# Add user account to sambashare
sudo smb passwd -a authuser1
# To find systems IP address:
ifconfig
# On Windows map network drive:
\\1.2.3.4\NAS