Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7545325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:53:53+00:00 2026-05-30T08:53:53+00:00

I have a Java executable that takes in command line arguments to launch root

  • 0

I have a Java executable that takes in command line arguments to launch root protected applications on my Linux box. We have separate user accounts that are given sudo access to launch the single Java executable, which the user can then use to launch the root protected apps. My understanding of sudo is that the user assumes the root ‘role’ during the single call and any subsequent calls thereafter (i.e. the calls the Java exec makes to the apps). It works for most of my applications, but only partially works for others. In particular the external applications being launched sometime don’t operate correctly and seem to output errors that they can’t open files (that are read accessible by all). If I run the executable as root, the executable and subsequent apps all run fine, so I know it has something to do w/ sudo.

I can provide more details if necessary but looking if anybody knows if sudo changes environment or runtime issues that I’m not aware of.

UPDATE:

The config files are in readable directories. To test for sure I made the binaries that the Java exec are trying to launch read accessible by all. From my tester account, I then launch the Java exec (w/o sudo) and the app runs fine. I then make just the binaries root protected, and run the Java exec with sudo and the application launch fails and gives me an error like:

“recorder: Fail to open edtrecorder.cfg”

That file and the directory its in are both read accessible by all.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:53:55+00:00Added an answer on May 30, 2026 at 8:53 am

    On some distributions (e.g. ubuntu) sudo runs programs using a restricted environment (with different search path) to the user shell running the command. This is a security feature; for example a program may have changed the PATH so that so that a rogue program is run instead of the real one when the user types a command – this would be catastrophic under sudo.
    See sudo changes PATH – why?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an existing java command-line program, that takes a bazillion of arguments and
I have a UNIX native executable that requires the arguments to be fed in
I have an application I've built that uses a non-Java executable that it calls
I have created an executable Java .jar file. That is to say, I properly
I have a java program that uses ProcessBuilder to call the unix sort command.
I have a Java application that I want to turn into an executable jar.
I have made a java application and have packed it into an executable jar
I have Java and Flash client applications. What is the best way for the
I have Java Map (out of Strings and Ints) objects that I want to
I have some java code that I want to share with some classmates however

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.