aspose file tools*
The moose likes Linux / UNIX and the fly likes Script to change User to root Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Script to change User to root" Watch "Script to change User to root" New topic
Author

Script to change User to root

Abiodun Adisa
Ranch Hand

Joined: Jan 17, 2002
Posts: 495
I want to write a script called say test.sh that when i execute it it would change the user logged in to root
Please how do i accomplish this
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15665
    
  15

More likely you just want to change the effective user ID. The "su" and "sudo" commands do that.


Customer surveys are for companies who didn't pay proper attention to begin with.
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4639
    
    5

Using sudo is much less of a security hole than setting to root. You really should lookup and use sudo
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Script to change User to root
 
Similar Threads
shell script problems
Not able to create textFile in server using php - urgent
how to validate
updating ejb module by scripting problems
check UID with Java