Asp.net 访问网络共享 [英] Asp.net Access To Network Share

查看:32
本文介绍了Asp.net 访问网络共享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 ASP.NET 应用程序,需要将文件保存到网络共享 (Samba).

I have an ASP.NET app which needs to save files to a network share (Samba).

共享需要用户名和密码才能连接.

The share requires a username and password to connect.

我已将永久驱动器映射到共享并提供登录凭据,同时以 DOMAINWEBUSER 身份登录到服务器.

I have mapped a persistent drive to the share and provided the login credentials whilst logged in to the server as DOMAINWEBUSER.

我已更改托管我的应用程序的虚拟目录,以使用 DOMAINWEBUSER 帐户而不是 IWAM 帐户.

I have changed the virtual directory which hosts my app to use the DOMAINWEBUSER account instead of the IWAM account.

但是用户仍然看不到映射的驱动器.

However the user still cannot see the mapped drive.

我错过了什么?

推荐答案

如果可以,最好使用 UNC,因为映射驱动器通常链接到交互式用户,并且虚拟目录可能正在连接服务或网络登录类型.

It is best to use the UNC if you can as the mapped drives generally are linked to the interactive user and the virtual directory is probably connecting with a service or netwrok login type.

此知识库文章中描述了另一个可能的修复方法将 IIS 配置为使用 Samba 网络共享时发生错误作为它的根.摘录如下.

Another possible fix is described in this KB articleError occurs when you configure IIS to use a Samba network share as its root. Excerpted below.

重要这些步骤可能会增加您的安全风险.这些步骤可能也使计算机或网络更容易受到恶意攻击用户或恶意软件,例如病毒.我们推荐的流程是这篇文章描述了启用程序按原样运行旨在或实施特定的程序能力.在你做之前这些变化,我们建议您评估相关风险通过在您的特定的环境.如果你决定要实施此过程,请采取任何适当的额外步骤来帮助保护系统.我们建议仅当您使用此过程时确实需要这个过程.

Important These steps may increase your security risk. These steps may also make the computer or the network more vulnerable to attack by malicious users or by malicious software such as viruses. We recommend the process that this article describes to enable programs to operate as they are designed to or to implement specific program capabilities. Before you make these changes, we recommend that you evaluate the risks that are associated with implementing this process in your particular environment. If you decide to implement this process, take any appropriate additional steps to help protect the system. We recommend that you use this process only if you really require this process.

警告此方法涉及安全风险,因为用户创建映射必须保持记录到本地控制台.所以,唯一的安全是通过锁定计算机.要解决此问题,执行以下操作:

Warning This method involves a security risk because the user who created the mapping must remain logged on to the local console. Therefore, the only security is by locking the computer. To work around this problem, do the following:

  1. 使用root"将驱动器号映射到 servernameiisroot 并密码."
  2. 在 Samba 虚拟目录中,将主目录从 Share 更改为在另一台计算机上到本地目录,然后指定驱动器您在第 1 步中映射的字母.
  3. 重新启动网站,然后通过浏览对其进行测试.

这篇关于Asp.net 访问网络共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆