runas - 1326:登入失敗:未知的使用者名稱或錯誤的密碼

runas - 1326:登入失敗:未知的使用者名稱或錯誤的密碼

我嘗試notepad使用cmd以下命令執行 -

runas /noprofile /user:<username>@<ip> notepad

然後我得到了這個輸出,要求我輸入密碼

Enter the password for <username>@<ip>:

輸入我的密碼(正確的)後,我得到了這個輸出-

Attempting to start notepad as user "<username>@<ip>" ...
RUNAS ERROR: Unable to run - notepad
1326: Logon failure: unknown user name or bad password.

知道為什麼我得到上面的輸出嗎?對於 Windows 終端中的程式設計和腳本編寫,我實際上是個傻瓜。另外,我是否可以避免要求輸入密碼的交互部分並將其作為runas命令本身的一部分輸入?

答案1

「user」參數需要由使用者名稱和(可選)網域名稱組成的使用者憑證,您在嘗試時不能使用 IP 位址。

runas /?

<UserName> should be in form USER@DOMAIN or DOMAIN\USER

如果您沒有網域,則可以使用目標電腦的名稱,以便它知道在那裡查找憑證儲存以進行檢查。

至於包含密碼,這樣您就不必輸入密碼,不,您不能這樣做,因為它被認為是不安全的。

或許可以看看這些與處理該問題相關的 SU 問題:

答案2

如果您想在命令列上指定使用者名稱和密碼,可以嘗試執行程式來自 Syinternals/微軟。

答案3

因為我還不允許發表評論...這是 Active Directory 環境,還是您嘗試從其他電腦存取使用者或群組。

如果是AD環境我建議不要使用IP而是使用網域名稱(NetBios名稱也可以)

我只是自己試了一下,結果成功了。 (結果是德語)

 C:\Users\user>runas /noprofile /user:[email protected] notepad
Geben Sie das Kennwort für "[email protected]" ein:
Es wird versucht, notepad als Benutzer "[email protected]" zu starten...

C:\Users\user>runas /noprofile /user:foo_bar\testuser notepad
Geben Sie das Kennwort für "foo_bar\testuser" ein:
Es wird versucht, notepad als Benutzer "foo_bar\testuser" zu starten...

C:\Users\user>runas /noprofile /user:foobar.com\testuser notepad
Geben Sie das Kennwort für "foobar.com\testuser" ein:
Es wird versucht, notepad als Benutzer "foobar.com\testuser" zu starten...

答案4

我在使用以下命令時也遇到了相同的問題。指令 – tscon SessionID /dest:console /password:****

解決方案:我做了很多工作,終於知道問題出在密碼上。即密碼長度不應大於13個字元。但在本例中密碼 = 20 個字元。

後來我將密碼更改為****(12個字元),問題已解決。

相關內容