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
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: 16145
    
  21

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: 4659
    
    5

Using sudo is much less of a security hole than setting to root. You really should lookup and use sudo
 
Don't get me started about those stupid light bulbs.
 
subject: Script to change User to root