Unix/Linux Go Back    


Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

How to give root access to non root user?

Shell Programming and Scripting


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 04-30-2013   -   Original Discussion by adisky123
adisky123 adisky123 is offline
Registered User
 
Join Date: Oct 2012
Last Activity: 23 December 2013, 5:57 AM EST
Posts: 58
Thanks: 5
Thanked 0 Times in 0 Posts
How to give root access to non root user?

Currently in my system Red Hat is installed. And Many user connect to my machine via SSH Techia Terminal.
I want to give some users a root level access.
Can anyone please help me how to make it possible. I too searched on the Google but didn't find the correct way

Regards
ADI
Sponsored Links
    #2  
Old Unix and Linux 04-30-2013   -   Original Discussion by adisky123
Jotne's Unix or Linux Image
Jotne Jotne is offline
Registered User
 
Join Date: Dec 2010
Last Activity: 20 September 2014, 2:08 AM EDT
Posts: 1,040
Thanks: 62
Thanked 213 Times in 203 Posts

Code:
su <command>

Sponsored Links
    #3  
Old Unix and Linux 04-30-2013   -   Original Discussion by adisky123
adisky123 adisky123 is offline
Registered User
 
Join Date: Oct 2012
Last Activity: 23 December 2013, 5:57 AM EST
Posts: 58
Thanks: 5
Thanked 0 Times in 0 Posts
Sorry I didn't get you.
    #4  
Old Unix and Linux 04-30-2013   -   Original Discussion by adisky123
rbatte1 rbatte1 is offline Forum Staff  
Root armed
 
Join Date: Jun 2007
Last Activity: 17 November 2017, 12:53 PM EST
Location: Lancashire, UK
Posts: 3,365
Thanks: 1,453
Thanked 665 Times in 598 Posts
Have a look at the manual pages for sudo and sudoers if they are installed. If not, have a look here

Basically, you can write rules for can be allowed to run certain commands. These can be scripts, or called in scripts.

Consider

Code:
$ ls -l
-rwxr-xr-x 1 ABCDE123 users        327 Jan  3 16:25 my_file
$ sudo chown ZYX99999 my_file
$ ls -l 
-rwxr-xr-x 1 ZYX99999 users        327 Jan  3

You could also do things such as:-

Code:
$ cat priv_script
#!/bin/ksh

print "I am running as `id -un`"
$ priv_script
I am running as ABCDE123
$ sudo su - ZYX99999 -c "/common/scripts/priv_script"
I am running as ZYX99999
$
$ sudo -u ZYX99999 ./priv_script
I am running as ZYX99999
$


Have a good search around these boards for hint on sudo too as many questions have already been asked and answered.



I hope that this helps,

Robin
Liverpool/Blackburn
UK
Sponsored Links
    #5  
Old Unix and Linux 04-30-2013   -   Original Discussion by adisky123
hanson44 hanson44 is offline
Registered User
 
Join Date: Mar 2013
Last Activity: 12 May 2013, 11:33 PM EDT
Posts: 858
Thanks: 18
Thanked 183 Times in 178 Posts
Quote:
I want to give some users a root level access
Why do you want to do that? What about the extreme security risk?
The Following User Says Thank You to hanson44 For This Useful Post:
jacobs.smith (05-01-2013)
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to allow access to some commands having root privleges to be run bu non root user suryashikha UNIX for Dummies Questions & Answers 5 10-30-2009 06:46 AM
access user history as root sardare Shell Programming and Scripting 4 07-01-2009 01:09 PM
I can not access root user through LAN rizwan225 Solaris 6 03-18-2009 07:03 PM
How to give an ordinary user the superuser (root) ID which is 0 sharaola UNIX for Dummies Questions & Answers 9 10-12-2008 03:52 AM
user commands without root access emealogistics HP-UX 1 05-27-2007 12:04 AM



All times are GMT -4. The time now is 01:07 AM.