Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Tools / April 2008

Tip: Looking for answers? Try searching our database.

Running netbeans project with root permissions

Thread view: 
Professor - 15 Apr 2008 20:45 GMT
I am working on a project in netbeans that needs to execute with root
permissions. Is there a way to configure the project to execute and/or
debug as a different user?

Ubuntu 8.04 beta
Netbeans 6.0.1
Lew - 16 Apr 2008 06:21 GMT
> I am working on a project in netbeans that needs to execute with root
> permissions. Is there a way to configure the project to execute and/or
> debug as a different user?
>
> Ubuntu 8.04 beta
> Netbeans 6.0.1

login or sudo as the desired user.  I sometimes start "netbeans &" from the
command line as root.  It's not actually a good idea.

Java truly is not a language designed for programs to run as root user.

I see that you're actually asking a deeper question, how to get NetBeans,
running as a normal user, to spawn a test run logged in as root.  I don't
think NB does that directly, though I could be ignorant of how it does.  As a
workaround, set up a .sh file to run the program as a Java application.  Make
it setuid root and executable, and execute it rather than the program.

Signature

Lew

Professor - 16 Apr 2008 13:34 GMT
> > I am working on a project in netbeans that needs to execute with root
> > permissions. Is there a way to configure the project to execute and/or
[quoted text clipped - 16 lines]
> --
> Lew

Thanks for the reply. I thought about using a script, but I'm also not
sure how to get netbeans to execute a script instead of a program when
selecting run (I doubt debugging would work at all through this
method). It sounds like i'll just have to run as root, The main reason
I don't want to run as root is I'm afraid all my config files will
then have root privileges and I won't be able to run netbeans as
anything but root next time. Oh well...

thanks again
Ted
CK - 17 Apr 2008 20:29 GMT
*snip*

>Thanks for the reply. I thought about using a script, but I'm also not
>sure how to get netbeans to execute a script instead of a program when
>selecting run (I doubt debugging would work at all through this
>method).

Another solution, just develop in NetBeans, then build your project
and then execute a shell script from the console sudoing to root?

--
Claus Dragon <clauskick@mpsahotmail.com>
=(UDIC)=
d++ e++ T--
K1!2!3!456!7!S a29
"Coffee is a mocker. So, I am going to mock."

- Me, lately.
Lew - 18 Apr 2008 12:46 GMT
> Thanks for the reply. I thought about using a script, but I'm also not
> sure how to get netbeans to execute a script instead of a program when
> selecting run

<http://ant.apache.org/manual/CoreTasks/exec.html>

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.