Sysinternals Homepage
Forum Home Forum Home > Sysinternals Utilities > PsTools
  New Posts New Posts RSS Feed: Unable to enter password using psexec
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Unable to enter password using psexec

 Post Reply Post Reply
Author
Message Reverse Sort Order
rbeede View Drop Down
Newbie
Newbie


Joined: 06 March 2007
Location: United States
Online Status: Offline
Posts: 19
Post Options Post Options   Quote rbeede Quote  Post ReplyReply Direct Link To This Post Topic: Unable to enter password using psexec
    Posted: 16 March 2007 at 12:43pm
Unfortunately the Runas program has been designed to reject any type of redirected stdin so as to prevent scripting of the password entry.  Due to how psexec grabs the streams Runas thinks it is a non-interactive input and rejects it.

Try looking at this alternative vbs script to Runas that should do the same thing:

http://www.actioncorp.net/lofiversion/index.php?t1856.html
Back to Top
byronaltice View Drop Down
Newbie
Newbie


Joined: 15 March 2007
Online Status: Offline
Posts: 2
Post Options Post Options   Quote byronaltice Quote  Post ReplyReply Direct Link To This Post Posted: 15 March 2007 at 2:20pm
rbeede:

following your advice, typed your first command to clean out previous login credentials to remote, there were none however, I then sucessfully executed your second command on the remote machine using administrator login/password.  The net use list shows the remote computer (d1013) having this (network resource?) mapped:

\\d1013\IPC$

I then used psexec to open the remote shell as you suggested from my computer to d1013:

psexec.exe -u mydomain\targuser -p targuserpass cmd.exe

This opens the shell successfully, however, the runas command returns the same error:

runas /user:mydomain\adminaccount "regsvr32 p_getlastinput.dll"
Enter password for mydomain\adminaccount:RUNAS ERROR: Unable to accept input

I should note that it doesn't even allow me to enter a password, as soon as i press enter after typing the runas command, it throws the error without giving me any time to enter a password.

Does this help clarify?

Please give me any other suggestions you may have.

------------------

Also, did you mean to omit the remote computer's name in your third command?  i figured it should be psexec \\d1013 -u mydomain\targuser -p targuserpass, but you have: psexec -u mydomain\targuser -p targuserpass


Edited by byronaltice - 15 March 2007 at 2:24pm
Back to Top
rbeede View Drop Down
Newbie
Newbie


Joined: 06 March 2007
Location: United States
Online Status: Offline
Posts: 19
Post Options Post Options   Quote rbeede Quote  Post ReplyReply Direct Link To This Post Posted: 15 March 2007 at 1:02pm
On machine where you run psexec.exe

NET USE \\remote /DELETE /Y
(cleans out any previous login cred to remote

NET USE \\remote /USER:myDomain\AdminAccount
(you may be prompted for a password, enter in the AdminAccount password)

PSEXEC.exe -u myDomain\TargUser -p targUserPass cmd.exe

You now have a command-shell as the user TargUser.  Just type in your RunAs there.





Edited by rbeede - 15 March 2007 at 1:03pm
Back to Top
byronaltice View Drop Down
Newbie
Newbie


Joined: 15 March 2007
Online Status: Offline
Posts: 2
Post Options Post Options   Quote byronaltice Quote  Post ReplyReply Direct Link To This Post Posted: 15 March 2007 at 11:55am
I'm currently trying to find a way to use psexec to remotely register some DLLs.  The systems I am remoting to have users that do not have the required rights to register DLLs, however, when registering DLLs they must be registered on that user's account.  Locally I can open a command prompt and use the runas command to call regsvr32 with administrator priviledges while on the user's account.  This registers the DLL successfully; however, when I try to do the same thing remotely using psexec, i get this error:
Enter password for ********\admin:RUNAS ERROR: Unable to accept input

(asterisks added to mask my domain name)

This is the syntax i used that spawned this error:
C:\temp>runas /user:********\admin "regsvr32 c:\p_getlastinput.dll"

that same command works correctly when run locally but doesn't allow me to input a password when run remotely with psexec.

Any help is appreciated.

------------------------------

Please also note that I am using the user's username and password when running psexec, not the administrator's.  If I use the administrator's username and password when running psexec, the DLL is registered under the administrator account and not the user account.  I need to figure out how to psexec into the user's account then use runas to run regsvr32 as an administrator, or I need to figure out how to use administrator's username and password with psexec but have regsvr32 affect the currently logged in user... which doesn't sound like what psexec can do.  ( Terminal Services vs VNC sort of problem).

----------------------------------------

Also, I have tried alternatives to runas, but I get similar errors.  I tried using CPAU: http://www.jsifaq.com/SF/Tips/Tip.aspx?id=7258 and the same command that works locally fails when calling cpau through psexec.  I have also tried SANUR: http://www.commandline.co.uk/sanur_unsupported/index.html and again, the same command that works locally fails when calling sanur through psexec.


Edited by byronaltice - 15 March 2007 at 12:29pm
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down