gpt4 book ai didi

windows - 使用 SSH 从 Linux Box 执行 Perl 脚本导致 "The local device name is already in use"

转载 作者:可可西里 更新时间:2023-11-01 10:38:38 24 4
gpt4 key购买 nike

我有一个 Perl 脚本,它映射两个驱动器,然后继续将一个驱动器的文件复制到另一个驱动器。 Perl 脚本位于 Windows 机器上,但我们从 Linux 机器通过 SSH 连接到 Windows 机器以执行脚本。当我直接从 Windows 框中运行脚本时,一切正常,驱动器已映射并且文件已成功复制。当我尝试通过 SSH 从我的 Linux 机器执行脚本时,脚本失败并且我得到以下输出:

The local device name is already in use.Error mapping source \\xxx.xxx.net\localdirectory

This error occurs when attempting to map the first drive, I don't know if it would fail on the second drive as well since it has not made it that far.

I have several other Perl scripts that are executed this same way (via ssh from Linux to Windows box) and they execute without issue, this is the only one that maps a drive though. This is the code I am using to execute the script:

#!/bin/sh

ssh -t -t user@server "cd /Path/to/Perl/Script; /cygdrive/C/Perl/bin/perl.exe Script.pl"

最佳答案

您的 ssh 守护程序以什么用户身份运行?估计是系统。据我所知,该用户无权映射网络驱动器。你不能直接在 Linux 机器上使用 samba 来做这个吗?

关于windows - 使用 SSH 从 Linux Box 执行 Perl 脚本导致 "The local device name is already in use",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11248371/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com