It's not a secret anymore!*
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 Android Security Essentials Live Lessons this week in the Android 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: 15959
    
  19

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

Using sudo is much less of a security hole than setting to root. You really should lookup and use sudo
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Script to change User to root
 
Similar Threads
how to validate
Not able to create textFile in server using php - urgent
shell script problems
check UID with Java
updating ejb module by scripting problems