我最近购买了一台新的 WD My Cloud,并且能够使用 FTP 应用程序将文件从运行 OMV 的旧机器传输到新的 NAS。但是,我似乎无法将 NAS 正确安装到我的 Ubuntu 笔记本电脑上以启用写入访问权限。我已包含文件的输出/etc/fstab
(我还使用管理员用户的用户名和密码安装了 NAS,而不是guest
),以及与文件权限和我认为可以正常工作但无法正常工作的东西(复制操作)相关的各种信息。理想情况下,我不想必须假设具有 root 权限才能写入 NAS,但我现在将其作为权宜之计。
~: cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/nvme0n1p2 during installation
UUID=28376594-b7ab-42c1-bb8c-71a3c5a799e1 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=E00C-C026 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
//192.168.1.221/Public /media/big-turtle cifs rw,user,guest,vers=3.0
~: sudo umount /media/big-turtle
umount: /media/big-turtle: not mounted.
~: mount /media/big-turtle
mount: (hint) your fstab has been modified, but systemd still uses
the old version; use 'systemctl daemon-reload' to reload.
~: cd /media/big-turtle
big-turtle: ll
total 4
drwxr-xr-x 2 dan dan 0 Jul 4 13:16 ./
drwxr-xr-x 6 root root 4096 Jul 4 13:51 ../
drwxr-xr-x 2 dan dan 0 Jul 4 13:25 Movies/
drwxr-xr-x 2 dan dan 0 Jul 4 12:22 'Screen Art'/
drwxr-xr-x 2 dan dan 0 Jul 4 10:26 Television/
big-turtle: whoami
dan
big-turtle: ll -n
total 4
drwxr-xr-x 2 1000 1000 0 Jul 4 13:16 ./
drwxr-xr-x 6 0 0 4096 Jul 4 13:51 ../
drwxr-xr-x 2 1000 1000 0 Jul 4 13:25 Movies/
drwxr-xr-x 2 1000 1000 0 Jul 4 12:22 'Screen Art'/
drwxr-xr-x 2 1000 1000 0 Jul 4 10:26 Television/
big-turtle: id
uid=1000(dan) gid=1000(dan) groups=1000(dan),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),121(lpadmin),131(lxd),132(sambashare)
big-turtle: mv ~/Downloads/Go.1999.720p.BluRay.999MB.HQ.x265.10bit-GalaxyRG\[TGx]/Go.mkv /media/big-turtle/Movies
mv: cannot create regular file '/media/big-turtle/Movies/Go.mkv': Permission denied
big-turtle: sudo mv ~/Downloads/Go.1999.720p.BluRay.999MB.HQ.x265.10bit-GalaxyRG\[TGx]/Go.mkv /media/big-turtle/Movies
[sudo] password for dan:
mv: cannot create regular file '/media/big-turtle/Movies/Go.mkv': Permission denied
big-turtle: lsattr /media/big-turtle
lsattr: Operation not supported While reading flags on /media/big-turtle/Television
lsattr: Operation not supported While reading flags on /media/big-turtle/Movies
lsattr: Operation not supported While reading flags on /media/big-turtle/Screen Art
答案1
我需要通过 SSH 进入 NAS 本身并在那里更改文件权限 - 文件的所有者是 root,我需要将其更改为管理员用户。现在,当我在文件中包括管理员用户名和密码时/etc/fstab
,我就可以写入 NAS。