5

I'm trying to invoke a program to run as another user (by getting input user/pwd) in AS400 OS using Java. Like runas in Windows or sudo in Unix — what can we do in AS400 OS?

I am able to invoke basic Unix commands like find, cd, ls etc. through Java on AS400.

I have very restricted access on the experimental AS400 sandbox provided to me. So I am not sure if sudo command through java will work when ran as admin.

I think on AS400 console STRQSH or QSH is a custom build program and all Unix commands are not supported. Hence I am clueless about what is the correct and concert way of doing it. Any guidance will be appreciated – how do the industry folks do it? Is there any sudo/runas equivalent in AS400? Do IBM have its own shell?

  • 1
    The security model on the AS400/iSeries is significantly different from Windows and Unix/Linux. You should probably spend a little time studying it before attempting to do much with security interfaces. – Hot Licks Aug 1 '12 at 16:19
  • 1
    Ask for a user profile that has the authorisation you need. – Buck Calabro Aug 1 '12 at 16:24
2

Take a look at the QSYGETPH api ... this will let you switch to a user profile that you have authority to.

| improve this answer | |
  • I wanted some solution such that I don't leave the java code. After QSYGETPH(invoke through java) we need to perform jobs with the same handle, so I cannot invoke a executable file sitting on IBM OS through java as a fresh user even after QSYGETPH api authentication is successful :( – AkD Aug 1 '12 at 17:23
  • I don't have access to QSYGETPH but it will be great to know if we can authenticate and execute a program as a single unit. You can authenticate & execute a executable as a single unit in window or unix through java using runas/sudo (using java runtime call). How can we achieve that in IBM OS. Any strategies? – AkD Aug 1 '12 at 17:38
  • Are you trying to switch credentials in the middle of a process ... or invoke a command using different credentials from within your Java code? – David G Aug 1 '12 at 18:14
  • invoke a command using different credentials from within your Java code. – AkD Aug 1 '12 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.