Script help on sudo access validation


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script help on sudo access validation
# 1  
Old 04-17-2016
RedHat Script help on sudo access validation

hello

I need help on this.

The input is this.

server system account name DBA account name x a p y b q z c r

so i would like to check the sudo of the user is done or not.

this is what i do to check it

Code:
1. login as root on server x
2. su - p (ie su - dba uid)
3. run sudo -u a -i ( ie to validte the sudo works on not)

How can i do this all all those rows from a admin-server where ssh keys for root are copied for server x,y & z

Last edited by jim mcnamara; 04-17-2016 at 12:26 PM..
# 2  
Old 04-17-2016
First off - unless the nopassword value is set in the entry in /etc/sudoers (or whatever file) you will have to enter the actual user's password - whatever that is - in order to test the sudo setup for an account. To determine if the sudo permissions are correct is a completely separate step.

Secondly - does the DBA username have those spaces in it? That looks like a horrible idea to me. It has the potential to mess up some scripts and applications that do not expect it.

Finally - I assume your test script does what you need. It is not testing any permissions that I can see. The assumption of that test is the nopassword flag is set for each DBA account.

FWIW this is a security hole. root should not be allowed to ssh to another box as root.
Code:
ssh keys for root are copied for server x,y & z


Let us know more and we can help you.

Last edited by jim mcnamara; 04-17-2016 at 12:38 PM..
# 3  
Old 04-17-2016
RedHat

Here is the tables

server system account name DBA account name x a p y b q z c r

i can ssh the servers remotely & passwd is not asked.

dba will not get the root but only sudo to "system account" , say oracle account.

---------- Post updated at 12:37 PM ---------- Previous update was at 12:37 PM ----------

table

HTML Code:
          server   system account name   DBA account name       x   a   p       y   b   q       z   c   r   

Last edited by Kiran008; 04-17-2016 at 02:38 PM.. Reason: table format
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using plink with sudo access

I have similar issue as mentioned in 167174-how-run-script-using-batch-file.html It works good, but the control is not coming back to source i tried adding exit to remote script. Thanks, Suresh (0 Replies)
Discussion started by: snsuresh
0 Replies

2. UNIX for Dummies Questions & Answers

Inheriting SUDO access?

I had a question on users inheriting SUDO capabilities of another account. Let's say that there are three users A, B, and C. A has access to Sudo into B. B has access to Sudo into C. Does this give A access to sudo into B and then sudo into C. A -> B B -> C A -> B -> C ? Another example. My... (2 Replies)
Discussion started by: sbcopty
2 Replies

3. Shell Programming and Scripting

Script to delete sudo access in redhat 5.4

Hi , This site is veryhelpful in resolving many issues.I have a request to delete sudo access for 3 users say user1,user2,user3 from around 50 servers in redhat 5.4.I know it is very time consuming to login to each server and delete entry in /etc/sudoers file.Is there any way can i do it... (4 Replies)
Discussion started by: muraliinfy04
4 Replies

4. Solaris

Sudo access in Solaris

Install the sudo pkg SFWsudo.tar bash#tar -xvf SFWsudo.tar bash#pkgadd -d . SFWsudo path may be /opt/sfw/bin Make entry the user name in sudoer file path of the sudoer file /opt/sfw/etc/sudoers check with the below command as a user (not as a root user) user1$... (1 Reply)
Discussion started by: Narendiran
1 Replies

5. UNIX for Advanced & Expert Users

Help needed in sudo access

I want to give root access to a user called denielr on server - tsprd01, but do not want to share root password. I have sudoers configured already. He should have all access equal to root. I made this entry in /etc/sudoers, but it is not working denielr tsprd01 =(root) NOPASSWD: ALL I tried to... (2 Replies)
Discussion started by: solaris_1977
2 Replies

6. Ubuntu

Restrict SUDO Access

Linux ubuntu 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux Hi Folks, Please help me. I am bit struck here. Here is the OS info. Linux ubuntu 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux I have a... (17 Replies)
Discussion started by: explorer007
17 Replies

7. UNIX for Dummies Questions & Answers

sudo/root access

I'm actually working with a Ubuntu-System here and have a question about executing a command with 'sudo'. I tried and got a error message like "not allowed". After this I logged in with 'sudo -s' and typed the command without 'sudo'. This worked well. Can please somebody explain me this... (0 Replies)
Discussion started by: daWonderer
0 Replies

8. Shell Programming and Scripting

ONLY SU Sudo access

Hello All, I want to create a script that will do ONLY su to any user on the server with hpadmin login using sudo. Can anyone let me know how can it do it. Regards Ankit (1 Reply)
Discussion started by: ajaincv
1 Replies

9. AIX

sudo user access

I have installed sudo on AIX 6100-04 and want to know how do I set it up for a user to be able to run only some commands? I want to give the user the rights to only cd to certain directories and run the ls command to name a few? Are there any issues with running sudo when the user is forced to... (2 Replies)
Discussion started by: daveisme
2 Replies

10. Linux

sudo access verification

Hi All, I got lots of request with sudo, a manager request, verbal command, do this and do that. The problem with this kind of request is when I added that script and that. It will not be perfect, it's because I can't verify the userid sudo access, I can't reset their password as well, I... (2 Replies)
Discussion started by: itik
2 Replies
Login or Register to Ask a Question