我正在使用容器化应用程序,这个文件系统导出到主机机器将成为安全问题,因为任何运行在主机上的容器都可以使用该共享。因此,对于我来说,这种 Linux 到 Linux 的挂载方法不起作用。
因此,我唯一的替代方案是在容器启动期间使用用户名/密码挂载此nas文件夹。
下面的命令适用于支持 Unix/Windows 的共享。我可以在容器启动时挂载。
mount -t cifs -osec=ntlmv2,domain=mydomain,username=svc_account,password=password,noserverino //nsnetworkshare.domain.company/share/folder /opt/testnas
我被告知我们应该使用nfs选项而不是cifs。 因此,我想知道使用nfs还是cifs会有什么区别。
指定nfs选项会出现以下错误。
mount -t nfs -o nfsvers=3,domain=mydomain,username=svc_account,password=password,noserverino //nsnetworkshare.domain.company/share/folder /opt/testnas
mount.nfs: remote share not in 'host:dir' format
以下命令似乎也无法正常工作。
mount -t nfs -o nfsvers=3,domain=mydomain,username=svc_account,password=password,noserverino nsnetworkshare.domain.company:/share/folder /opt/testnas
mount.nfs: an incorrect mount option was specified
我找不到一个带有用户名/密码的mount -t nfs选项示例。因此我认为我们不能使用具有凭据的mount -t nfs命令。
请提出想法。
谢谢,
Vishnu