linux permission
1 posts in topic
Flat View  Flat View

Posted By:   Anonymous
Posted On:   Wednesday, June 25, 2003 01:43 AM

I want to execute some linux command in java program, these command should be executed by the super user in linux command line. But i want to use "Runtime.getRuntime().exec" to execute these command. How can i get the sufficient permission to do this?

for example: Runtime.getRuntime().exec("/usr/sbin/chpasswd < /home/florence_xd/test")

Thanks a lot

Re: linux permission

Posted By:   Christopher_Koenigsberg  
Posted On:   Monday, June 30, 2003 11:06 AM

Either "su", or "sudo" (if sudo is set up for you and the given command), or else run an executable that is "setuid root" e.g. chmod 4755 and chown root (don't do this with a script, because it is a big security hole).

About | Sitemap | Contact