Start process in different user

Discussion in 'Java' started by Li Ma, Feb 18, 2006.

  1. Li Ma

    Li Ma Guest

    I need to run a Shell script or program with Java's Runtime.exec()
    method. The script works great, But the new problem is sometime, I have
    to run the script as a different user from the one who started current
    Java app.

    I was trying to use "sudo" or "su -c" to run the script. But the
    parameters cannot be passed over in Unix. So my question is anyway in
    Java world that allow start a new process as different user?

    Thanks
     
    Li Ma, Feb 18, 2006
    #1
    1. Advertising

  2. Li Ma

    James McGill Guest

    On Sat, 2006-02-18 at 07:03 -0800, Li Ma wrote:

    > But the
    > parameters cannot be passed over in Unix.


    Why not? What's your first argument to Runtime.exec ?
     
    James McGill, Feb 18, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shawn Anderson
    Replies:
    7
    Views:
    724
    =?Utf-8?B?TWFyayBEdXJlZ29u?=
    Jul 14, 2004
  2. =?Utf-8?B?bWc=?=
    Replies:
    6
    Views:
    9,099
  3. Lucas Tam
    Replies:
    0
    Views:
    531
    Lucas Tam
    Jun 17, 2005
  4. jpock76
    Replies:
    0
    Views:
    633
    jpock76
    Aug 23, 2010
  5. Shawn Anderson
    Replies:
    7
    Views:
    146
    Mark Duregon
    Jul 14, 2004
Loading...

Share This Page