1. 程式人生 > >virsual studio等AP無法訪問網路對映驅動器(map network drive)的解決辦法(二)

virsual studio等AP無法訪問網路對映驅動器(map network drive)的解決辦法(二)

前面一篇文章已經提到了問題所在:

直接通過 對映網路(map network drive) 硬碟,run as Administrator的AP會出現無法訪問的情況,這是因為直接通過explorer上的map network drive按鈕進行對映網路硬碟的動作是沒有run在Admnistrator許可權下的,訪問許可權不match導致run as Adninistrator的AP無法訪問對映網路硬碟。

參考:

http://woshub.com/how-to-access-mapped-network-drives-from-the-elevated-apps/

    解決辦法有很多種:

方法一:前文提到的修改登錄檔中EnableLUA來解決,是Disable UAC,修改EnableLUA=0,disable UAC。它不同於我們經常使用的Disable UAC notification,而是真正的disable UAC。

參考:https://msdn.microsoft.com/zh-cn/library/ff715520.aspx

EnableLUA specifies whether Windows® User Account Controls (UAC) notifies the user when programs try to make changes to the computer. UAC was formerly known as Limited User Account (LUA).

true

Windows notifies the user when programs try to make changes to the computer.

This is the default value.

false

Windows does not notify the user when programs try to install software or make changes to the computer.

We do not recommend using this setting, but it can be selected for systems that use programs that are not certified for Windows(R) 8, Windows Server® 2012, Windows(R) 7 or Windows Server® 2008 R2 because they do not support UAC.

    筆者實測,這種修改方法在Win10上會帶來一個問題,那就是部分AP無法執行,並且彈出“無法使用內建管理員賬戶開啟此應用,請使用其他賬戶登入,再試一次”。測試使用者型別:administrator,測試AP:calc.exe。產生這個問題的根源在於MS在Win10上增加了一些新的安全策略。詳細資訊可以參考:

https://social.technet.microsoft.com/Forums/en-US/b06a0e1f-0d2e-4978-8eb5-49a7d766d49f/if-i-use-windows-10-default-administrator-account-i-cant-open-applications-else-my-operation?forum=win10itprogeneral

This behavior is by design.  The built-in administrator account is disabled and should only be enabled when there are no other administrator accounts available.  Enabling and using the built-in administrator account is not recommended and opening certain applications with that account will yield the "This app can't open" message.

During the out of box setup an account is created and added to the default administrators group.  This is the account that should be used.

文中提出瞭解決辦法是,重新建立一個非administartor許可權的使用者,在這個使用者上執行。筆者嘗試新建一個standard user,在這個使用者上執行calc.exe成功。

    很明顯,上述策略需要在不同的使用者去執行不同許可權的AP,這不是我們想要的結果。那麼我們只能繼續尋找其他方法。

方法二:在Administartor下利用net use來建立網路對映,net use使用說明如下:

NET USE
[devicename | *] [\\computername\sharename[\volume] [password | *]]
        [/USER:[domainname\]username]
        [/USER:[dotted domain name\]username]
        [/USER:[[email protected] domain name]
        [/SMARTCARD]
        [/SAVECRED]
        [[/DELETE] | [/PERSISTENT:{YES | NO}]]


NET USE {devicename | *} [password | *] /HOME


NET USE [/PERSISTENT:{YES | NO}]

簡單舉個例子:

net use x: \\10.0.0.1\dir PASSWD /user:USERNAME

USERNAME和PASSWD分別為 \\10.0.0.1\dir的使用者名稱和密碼

利用Administartor執行後其他執行在Administartor的AP便可訪問x盤。這個方法的優點是不需要修改登錄檔、使用者資訊,缺點是每次啟動需要手動執行或者建立bat加入自啟動。

方法三:修改登錄檔項EnableLinkedConnections

  • Open the registry editor (regedit.exe)
  • Go toHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
  • Create a new parameter (DWORD type) with the name EnableLinkedConnections and the value 
  • restart

這種方法的原理如下,不同許可權對應於不同的access token,普通許可權map的network drive用的是token2,administtrator許可權用的是token1,這樣無法利用token1訪問token2 map的network drive。而EnableLinkedConnections=1,在map network drive的同時,check是否有多個token,如果有則同時為所有的token做一份copy,保證每個token都可以訪問此network mapped drive.

root cause:

Why does it happen? This peculiarity is connected with UAC mechanism for a user with the local administrator privileges. The matter is that when this user signs in, two access tokens are created: the first token provides access without the administrator privileges (the filtered access token, with which most apps are run) and the second is the administrator token with full privileges in the system (all apps approved elevated in UAC are run using it).

When connecting shared network folders, they are associated with the current session for the current process access token and are not available with another token.

solution:

How it works. After you enable EnableLinkedConnections parameter of the registry, LanmanWorkstation and LSA will check if there is the second access token associated to the session of the current user. If this token is found, the list of the mounted network drives will be copied from one token to another. Thus, the network drives mounted elevated will be seen in the standard mode, and vice versa.

參考:

http://woshub.com/how-to-access-mapped-network-drives-from-the-elevated-apps/

總結下最簡單方法的方法:

  • Open the registry editor (regedit.exe)
  • Go toHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
  • Create a new parameter (DWORD type) with the name EnableLinkedConnections and the value 
  • restart

相關推薦

virsual studioAP無法訪問網路對映驅動器(map network drive)的解決辦法

前面一篇文章已經提到了問題所在: 直接通過 對映網路(map network drive) 硬碟,run as Administrator的AP會出現無法訪問的情況,這是因為直接通過explorer上的map network drive按鈕進行對映網路硬碟的動作是沒有run

zz: virsual studioAP無法訪問網路對映驅動器(netmap drive)的解決辦法

ZZ from: http://www.tuicool.com/articles/M3Mrmyy 【問題產生】 問題最初是在administrator許可權下,visual studio 開啟網路磁碟下的檔案報錯。經過幾次除錯,最終發現是問題是在 管理員 許可權下,vs無法訪問網路磁碟。 Consol

QT、VS常見bug及解決辦法——VS錯誤 2 error LNK1120: 1 個無法解析的外部命令

這個問題的原因是有標頭檔案,但是找不到實現。 有兩個原因: 1.只包含了標頭檔案,只有這個函式的宣告,沒有包含這個函式的實現(實現一般放在cpp檔案中的)。所以只能通過編譯,連線不成功。 2.另一個原因是函式的宣告和實現都放在標頭檔案中了,一般要把宣告放標頭檔案中,實現放在c

eclipse 無法啟動 JVM terminated. Exit code=-1 的解決辦法 轉載

這兩天,突然無法啟動我的MyEclipse6.5了,不知道為什麼,提示錯誤: JVM   terminated. Exit   code=-1。 昨天,我以為是機器執行時間太長,重啟一下,果然好了。但是今天又來了。看了一下錯誤提示,我以為是JVM有問題,就在啟動Eclipse

tomcat釋出程式無法訪問網路對映解決方法

系統環境:Tomcat6/JDK1.6/JAVA 伺服器:windows2003,伺服器映射了一個網路硬碟     開發環境下發布系統XP能夠正常訪問對映過來的磁碟內容,但是系統部署到正式伺服器時發現,程式不能對網路硬碟進行檔案讀取。排除了程式出錯的原因,初步估計是由於使

關於 通過http請求 無法訪問Linux下的ftp服務的解決辦法

解決辦法 text alt blog mark ftp mar 分享 代碼 解決辦法:1.首先進入到NGINX配置文件下面: 然後繼續往下: 其中 “server_name”表示的是本機IP 也可設置成 “localhost”,“location”表示本地的意思 。 先

關於--windows能ping通linux的ip,但是無法訪問linux的tomcat首頁 的解決辦法

CentOS版本:6.8 Windows作業系統版本:Win10 Linux上的tomcat版本:7.0.65 linux是使用的NAT模式,及共享主機的IP地址。本來想使用windows本地訪問linux上的tomcat首頁,結果一直訪問不成功;但在windows下能

KVM使用virsh console無法連接的解決辦法

AMF nbsp sca roo etc ive pat clas efault 一、問題描述: KVM中宿主機通過console無法連接客戶機,卡在這裏不動。 # virsh console vm01 Connected to domain vm01 Esca

apache2.2服務無法啟動 發生服務特定錯誤:1 的解決辦法 windows服務錯誤 日誌查看方法

管理器 tps httpd com tail 文件 電腦 fix apache2 轉 https://blog.csdn.net/liuensong/article/details/6738041 查錯過程: 1、查看apache錯誤日誌:目錄下的apache/

WIN7 64位系統 CDC類 虛擬串列埠驅動無法安裝的解決辦法2

(1)最近用STM32使用USB——CDC類出現驅動安裝失敗的情況。 百度了一些網頁,方法很多,大多數是按照如下步驟處理: 首先,確保C:\Windows\System32\drivers\usbser.sys檔案存在; 其次,修改C:\Windows\inf\mdmcpq.inf檔

吳恩達《神經網路與深度學習》課程筆記歸納-- 神經網路基礎之邏輯迴歸

上節課我們主要對深度學習(Deep Learning)的概念做了簡要的概述。我們先從房價預測的例子出發,建立了標準的神經網路(Neural Network)模型結構。然後從監督式學習入手,介紹了Standard NN,CNN和RNN三種不同的神經網路模型。接著介紹了兩種不

C#網路程式設計之---TCP協議的同步通訊

上一篇學習日記C#網路程式設計之--TCP協議(一)中以服務端接受客戶端的請求連線結尾 既然服務端已經與客戶端建立了連線,那麼溝通通道已經打通,載滿資料的小火車就可以彼此傳送和接收了。現在讓我們來看看資料的傳送與接收 先把服務端與客戶端的連線程式碼敲出來 服務端 IPAddress ip = new IP

hadoop:datanode無法正常啟動的解決辦法

hadoop 多次執行命令: hadoop namenode -format後,發現再次啟動hadoop後,datanode節點無法正常啟動,出現錯誤程式碼如下: could only be replicated to 0 nodes, instead

window.location.href無法跳轉的解決辦法整理

 必須在event() 後新增 return false; 在跳轉函式event()內新增return false不行。  注意:如果是通過ajax返回值進行是否跳轉,在ajax請求是新增一個隨機引數。 我的解決程式碼:  <!--必須加上return fasle否則跳轉不了-->

QT、VS常見bug及解決辦法——錯誤    1    error LNK2019: 無法解析的外部符號

問題1:無法解析的外部符號 "void __cdecl cv::fastFree(void *)" 錯誤 1 error LNK2019: 無法解析的外部符號 "void __cdecl cv::fastFree(void *)" ([email protecte

Kali Linux 網路掃描祕籍 第三章 埠掃描

第三章 埠掃描(二) 作者:Justin Hutchens 譯者:飛龍 3.6 Scapy 隱祕掃描 執行 TCP 埠掃描的一種方式就是執行一部分。目標埠上的 TCP 三次握手用於識別埠是否接受連線。這一型別的掃描指代隱祕掃描

經驗總結-完整介紹Android Studio中Git的使用之在GitHub上建立一個遠端倉庫

說完本地Git倉庫,那麼如何將專案上傳至遠端的GitHub倉庫呢?首先我們需要有一個託管平臺,然後需要建立一個倉庫。現在我們開始註冊一個GitHub賬號,然後去後new 一個倉庫吧: 一、首先我們需

在Android中訪問內建SE和基於SE的卡模擬

改變SE工作模式 在NfcAdapterExtras類中,有兩個關於卡模擬的函式,getCardEmulationRoute和setCardEmulationRoute,分別用於得到和設定卡模擬工作模式,其中getCardEmulationRoute返回一個CardEmul

【Tensorflow】怎樣為你的網路預加工和打包訓練資料?:小資料集的處理方案

實驗環境:python2.7 第二篇我們來講一講小資料集的處理方法,小資料集一般多以文字儲存為主,csv是一種流行的資料格式,另外也有txt等。當然也會有.mat或者.npy這種經過處理的格式。 一.處理csv格式資料集 實驗資料集是鳶尾花卉資料集iris,格式是.csv

win7 win10開啟網路訪問(網路訪問 無法訪問 網路訪問需要輸入密碼 問題處理)

狂客原創,轉載請註明。侵權必究!   右鍵單擊桌面的“網路”圖示 選擇“屬性”。 在彈出的“網路和共享中心”視窗,點選“更改高階共享設定”。 參考文章:https://jingyan.baidu.com/article/c275f6ba32ca5ce33d75673c.html 設定