raspberry-pi - 在 Raspberry Pi 网络附加存储 (NAS) 上安装 Anaconda3 时权限被拒绝
问题描述
桑巴
我在 Raspberry Pi 4b 上安装了 Raspbian Lite 和 Samba。我从 Linux(Ubuntu 18.04.5 LTS)客户端访问 Raspberry Pi。我正在使用 bash 并且 ufw 在两台机器上都处于非活动状态。下面是我的 smb.conf 文件。
[global]
workgroup = WORKGROUP
log file = /var/log/samba/log.%m
max log size = 1000
logging = file
panic action = /usr/share/samba/panic-action %d
server role = standalone server
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user
usershare allow guests = yes
[homes]
comment = Home Directories
browseable = no
read only = yes
create mask = 0700
directory mask = 0700
valid users = %S
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = yes
read only = yes
create mask = 0700
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = no
guest ok = no
[home]
path = /mnt/raid1
writeable = yes
create mask = 0777
directory mask = 0777
public = no
read only = no
browseable = yes
我正在尝试在 Linux x86_64 机器上安装最新版本的 Anaconda,并将 PREFIX 设置为位于 NAS 上的文件夹。我正在尝试按照文档中的说明安装 Anaconda。我可以在外部硬盘驱动器或本地硬盘驱动器上安装 Anaconda,而不会出现任何问题。我还从 Windows 10(64 位)客户端访问 NAS。当我在 Windows 10 客户端上安装 Anaconda 并在我的 NAS 上选择一个文件夹作为目标文件夹时,它也可以工作。但是,当我尝试在 Linux 机器上安装 Anaconda3 并将 PREFIX 设置为我的 NAS 上的文件夹时,我收到以下错误:
Unpacking payload ...
Downloads/Anaconda3-2020.11-Linux-x86_64.sh: Line 412: /media/samba/niko/anaconda3/conda.exe: Permission Denied
Downloads/Anaconda3-2020.11-Linux-x86_64.sh: Line 414: /media/samba/niko/anaconda3/conda.exe: Permission Denied
- 我尝试使用不同的 Samba 帐户在同一个 Linux 客户端上安装 Anaconda 并得到相同的错误。
- 我尝试在 Ubuntu 18 客户端上与两个 Samba 用户一起安装最新版本的 Miniconda,但遇到了同样的错误。
我尝试使用相同的两个 Samba 帐户在我的网络上的另一台 Linux 机器(Ubuntu 16.04.7 LTS)上安装 Anaconda3。不幸的是,两个用户都收到以下错误:
PREFIX=/Path/To/anaconda3
Unpacking payload ...
0%| | 0/36 [00:00<?, ?it/s]
Could not remove or rename /$PREFIX/pkgs/libedit-3.1.20191231-h14c3975_1o4380296/pkg-libedit-3.1.20191231-h14c3975_1.tar.zst. Please remove this file manually (you may need to reboot to free file handles)
concurrent.futures.process._RemoteTraceback:
'''
Traceback (most recent call last):
File "concurrent/futures/process.py", line 368, in _queue_management_worker
File "multiprocessing/connection.py", line 251, in recv
TypeError: __init__() missing 1 required positional argument: 'msg'
'''
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "entry_point.py", line 69, in <module>
File "concurrent/futures/process.py", line 484, in _chain_from_iterable_of_lists
File "concurrent/futures/_base.py", line 611, in result_iterator
File "concurrent/futures/_base.py", line 439, in result
File "concurrent/futures/_base.py", line 388, in __get_result
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
[5437] Failed to execute script entry_point
- 同样在 Ubuntu 16 客户端上,我尝试安装最新版本的 Miniconda,但对于两个 Samba 帐户,我都遇到了与上面显示的相同的错误。
以下是我的 NAS 和我的 Linux 客户端上的 anaconda3 目录的挂载点的权利和所有者
drwxr-xr-x niko niko mount point (niko is the user account on my Linux client Ubuntu 18)
├── drwxr-xr-x 2 niko niko anaconda3
│ └── -rwxr-xr-x 1 niko niko conda.exe
└── some folder
- 在 Ubuntu 16 客户端上,它看起来完全像这样,除了用户名不同,但它们都有 uid=1000 和 gid=1000。
以下是树莓派上我的硬盘挂载点上文件夹的权利和所有者,可以使用 SMB 协议通过网络访问
drwxr-xr-x 7 pi pi mount point
├── some folder
├── drwx------ 2 pi pi
├── some folder
├── drwx------ 4 pi pi
│ ├── drwxrwxrwx 2 pi pi anaconda3
│ │ └── -rwxrw-rw- 1 pi pi conda.exe
│ └── drwxrwxrwx 3 pi pi
│ └── drwxrwxrwx 20 pi pi
│ ├── drwxrwxrwx 41 pi pi
│ └── -rwxrw-rw- 1 pi pi
└── some folder
- 除了 anaconda3 文件夹之外,我添加了权限(用户、组、其他)以及拥有 Raspberry Pi 上的文件夹和文件的用户和组的名称,而不是文件夹和文件名。如您所见,当我使用用户 pi 登录时,挂载点目录中的每个文件、文件夹和子文件夹都属于用户 pi 和组 pi。
这是/etc/fstab
我用来自动挂载 Samba 服务器的行
//192.168.178.96/home /media/samba cifs credentials=/Path/To/My/Credentials,users,uid=1000,gid=1000 0 0
NFS
我在 Raspberry Pi 上安装并配置了 NFS 服务器。然后我还尝试使用 NFS 协议在我的 Ubuntu 18 客户端上安装最新版本的 Anaconda 和 Miniconda。但是我得到了与使用 SMB 协议时相同的错误。
Ubuntu 18 客户端 NFS 服务器挂载点和树莓派硬盘挂载点的权限和所有者与 Samba 部分中提到的两个挂载点相同。
下面是我/etc/exports
在树莓派上的文件
/mnt/nfs/niko/Ubuntu 192.168.178.0/24(rw,sync,insecure,no_subtree_check,no_root_squash,anonuid=1000,anongid=1000)
这是/etc/fstab
我用来自动挂载 NFS 服务器的行
192.168.178.96:/mnt/nfs/niko/Ubuntu /media/nfs nfs rw,user,hard,intr 0 0
以下是位于 Linux 客户端上的 anaconda-installer.sh 和 miniconda-installer.sh 文件的权利和所有者
-rw-rw-r-- 1 username groupname Anaconda3-2020.11-Linux-x86_64.sh
-rw-rw-r-- 1 username groupname Miniconda3-latest-Linux-x86_64.sh
提前感谢您的帮助和反馈!
解决方案
请注意,当前 /opt/anaconda 必须是受支持的文件系统,例如 ext4 或 xfs,并且不能是 NFS 挂载点。/opt/anaconda 的子目录可以通过 NFS 挂载。例如,对象存储服务支持 NFS 后端。
( https://enterprise-docs.anaconda.com/en/docs-site-5.0.6/admin-guide/install/requirements.html )
推荐阅读
- javascript - 使用 react 进行 API 调用
- csv - Logstash 启动成功但不起作用
- javascript - 如何模拟
在 React 中使用 Jest 和 Enzyme - swiftui - 在 SwiftUI 中实现标签列表
- react-native - React Native/ Ionic/ Apache Cordova 中的服务工作者
- c++ - 如何在 Linux 上安装 OpenXLSX?
- html - 如何阻止固定对象离开其父容器?
- java - 我想获取文件文本行并放入一个数组中,以便稍后比较重复的行
- c# - 为什么这段代码会导致 Stack Overflow c#?
- python - 导入csv文件,根据第一个表头计算平均值并创建图形