我想在终端上挂载一个SMB共享。如果服务器名称中没有空格,我可以使用以下命令:
$ mount -t smbfs //user:password@server/resource /Volumes/resource
然而在我的情况下,服务器名称中有一个空格,我无法弄清楚如何正确传递这样的名称。
我尝试使用双引号或单引号:
$ mount -t smbfs "//user:password@ser ver/resource" /Volumes/resource
mount_smbfs: URL parsing failed, please correct the URL and try again: Invalid argument
我尝试转义空格:
$ mount -t smbfs //user:password@ser\ ver/resource /Volumes/resource
mount_smbfs: URL parsing failed, please correct the URL and try again: Invalid argument
我还尝试使用 %20
、\x20
和 \040
,但是我收到了一个错误:
mount_smbfs: server connection failed: No route to host
我知道我可以使用IP地址或重命名服务器,但那只是一种解决方法而不是真正的解决方案,我在想我错过了什么。
fstab
中添加它吗? - Atropo%20
对我在 macOS zsh 上起作用了,但它是在资源名称中而不是服务器名称中。mount -t smbfs //me:password@NAS/My%20Backups ~/My\ Backups
。奇怪。 - Joshua Pinter