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

Script to change User to root

Abiodun Adisa
Ranch Hand

Joined: Jan 17, 2002
Posts: 495
I want to write a script called say 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: 17018

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

Joined: Aug 11, 2007
Posts: 4659

Using sudo is much less of a security hole than setting to root. You really should lookup and use sudo
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Script to change User to root
It's not a secret anymore!