how to run a process as user LocalService?

A

Adam Dingle

Even when I'm logged in as an administrator, I can't seem to get the
runas utility to run a process as user NT AUTHORITY\LocalService:

============
C:\adamd>runas /u:"NT AUTHORITY\LocalService" notepad.exe

Enter the password for NT AUTHORITY\LocalService:
RUNAS ERROR: Unable to acquire user password
C:\adamd>
============

Even the mighty psexec utility from sysinternals.com seems to fail
here too:

============
C:\adamd>psexec -i -d -u "NT AUTHORITY\LocalService" notepad.exe

PsExec v1.43 - execute processes remotely
Copyright (C) 2001-2003 Mark Russinovich
www.sysinternals.com

Password:

PsExec could not start notepad.exe on SUMMER:
Logon failure: unknown user name or bad password.

C:\adamd>
============

(I know that the LocalService account has no password (see
http://msdn.microsoft.com/library/d...y/en-us/dllproc/base/localservice_account.asp)
and so I'm just hitting Enter in response to the password prompts
above.)

I'm testing out some code which will ultimately run as a system
service under the LocalService account, so it would help me to be able
use runas or a similar utility to try it out in this account. Is it
possible?

adam
 
T

Tim Robinson

You can't actually log on as LocalService; that would be a security hole.

However, if an already running service starts a process, then that process
will default to starting under LocalService. You can do this using AT to
schedule a job in the near future.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top