Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用于在linux计算机中装载windows网络位置的Shell脚本_Linux_Shell_Window_Mount_Cifs - Fatal编程技术网

用于在linux计算机中装载windows网络位置的Shell脚本

用于在linux计算机中装载windows网络位置的Shell脚本,linux,shell,window,mount,cifs,Linux,Shell,Window,Mount,Cifs,我这里有两个问题。通过执行以下操作,我可以在我的Ubuntu计算机中安装windows网络路径: sudo mount -t cifs -o username=user \\\\my_windows\\test /net/loc Windows机器中的所有文件和文件夹现在都可以在Ubuntu机器中使用,路径为“/net/loc” 以下是我的疑问: 我可以在linux路径中看到windows的所有文件。是否可以在Linux路径(安装windows路径的安装路径)中创建文件/文件夹,并将其反映在w

我这里有两个问题。通过执行以下操作,我可以在我的Ubuntu计算机中安装windows网络路径:

sudo mount -t cifs -o username=user \\\\my_windows\\test /net/loc
Windows机器中的所有文件和文件夹现在都可以在Ubuntu机器中使用,路径为“/net/loc”

以下是我的疑问:

  • 我可以在linux路径中看到windows的所有文件。是否可以在Linux路径(安装windows路径的安装路径)中创建文件/文件夹,并将其反映在windows计算机中?我无法在安装了windows网络位置的Linux计算机上编写。它向我抛出错误“无法打开文件进行写入”

  • 我正在尝试编写一个shell脚本(ksh文件),它将挂载windows网络路径。我在文件中编写了下面的mount命令,但该命令提示输入密码。有没有办法,我可以在shell脚本中编写命令,它不会要求我输入密码,我可以将其作为参数或其他机制传递

    mount-t cifs-o username=user\\my\u windows\test/net/loc


  • 谢谢

    密码可按如下方式传递

    sudo mount-t cifs-o username=${USER},password=${password},uid=,gid=//服务器地址/文件夹/mount/path/on/ubuntu

    通过root访问,我能够在Linux路径中编写代码


    更多信息在这里

    在这里获得了密码和写访问权限的回复。