how can i add the user or remore the file using java programe
2 posts in topic
Flat View  Flat View

Posted By:   Anonymous
Posted On:   Wednesday, May 30, 2001 07:09 AM

hello i am bilal from u-e-t lahore pakistan and i am in final year in electrical department.i want to ask you that i can use some linux commands in my java programe like dir,ls,whoami,etc
but i can not create the user delete the file using java programe please give me the answer and please send the compleate simple code for this.


Re: how can i add the user or remore the file using java programe

Posted By:   Nathan_Meyers  
Posted On:   Thursday, May 31, 2001 07:34 PM

It sounds like you know how to run commands using
System.exec(), but you are finding that some commands
do not work, right?

As Ivo said, you probably have a permissions problem.
Unix and Linux have a permissions structure that prevents
users from interfering with other users and the system,
and reserves certain operations (such as creating
new users) to system administrators.

If users are logged into the Linux system and running
your programs, the programs will have the same rights
the users have: they can manage their own files and
directories, but not those of other users.

If, on the other hand, the Java code is running
as a remote service - for example, as servlets - then
it has whatever permissions are assigned to whomever
is running the server process. Please see href="http://www.jguru.com/faq/view.jsp?EID=428051">this
FAQ entry for a discussion of the problems of
user privileges in remote services.

Re: how can i add the user or remore the file using java programe

Posted By:   Ivo_Limmen  
Posted On:   Wednesday, May 30, 2001 07:25 AM

Your Java Virtual Machine does not have the rights to preform this action. To add a user you need to be administrator, the Java Virtual Machine doens not have administrator rights. You must run the Java Virutal Machine under the administrator account or give the Java Virtual Machine the administrator rights but this might be a dangerous option. I am no *nix specialist (I use Windows only) so I suggest to find more information about this on site's concering Linux and security.
About | Sitemap | Contact