SUDO command in script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SUDO command in script
# 1  
Old 10-05-2015
SUDO command in script

hi,

can some one explain the sudo -n equivalent in AIX

Thanks
Venkat K
# 2  
Old 10-05-2015
What makes you think it is AIX specific??

-n argument is used mostly in batches ( -n -> no interaction... ) to avoid sudo prompting for a passwd... will exit with an error instead...
# 3  
Old 10-05-2015
Hi Vbe,

I actually trying to find equivalent to sudo -n on AIX.

As i have nearly 500 servers, some are REDHAT and some are AIX, requirement is to monitor whether a user(say VENKAT) is having root acess or not.

On REDHAT i can check it without any problem with sudo -n id , if it prompts password it ill generate an error or it will just give the output.

But on AIX i am getting redirected to password prompt, my script got struck in there.

Please help

Thanks
Venkat
# 4  
Old 10-05-2015
The problem is not a different kind of sudo. The problem is that sudo is configured differently on some servers than others.

If you want sudo to let that user in passwordlessly for that particular command, configure sudo to let that user in passwordlessly for that command.
This User Gave Thanks to Corona688 For This Post:
# 5  
Old 10-07-2015
Hi,

Thanks for you replies

Regard's, i got my issue resolved.

how can i make this tread to resolved status
Venkat
# 6  
Old 10-07-2015
Hello Venki,

Whenever there is a thread after top title there is an option named EDIT TAGS. You can click there and then add the specific tags related to any thread, for an example--> solved or solved awk etc to make this thread status as solved.

Thanks,
R. Singh
This User Gave Thanks to RavinderSingh13 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Question regarding sudo command

Hi, I get error when sudo -u user1 -s -H (AD: coro.int) Password: cannot access parent directoriesI do not get error when sudo -u user1 -i -HCan you tell me why do i not get error when using -i option instead of -s option with sudo. $ uname -a SunOS mymac 5.10 Generic_150400-26... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. AIX

issue with cd command on sudo

Hi admins, I have installed sudo in aix 5.3 and configured sudoers file.Every command is working fine with sudo except cd . If i give sudo cd /etc/security it returns nothing.There is no pwd change and no any error messages. sudo -l command returns all executables including cd. sudo ls... (8 Replies)
Discussion started by: newaix
8 Replies

3. Shell Programming and Scripting

ssh foo.com sudo command - Prompts for sudo password as visible text. Help?

I am writing a BASH script to update a webserver and then restart Apache. It looks basically like this: #!/bin/bash rsync /path/on/local/machine/ foo.com:path/on/remote/machine/ ssh foo.com sudo /etc/init.d/apache2 reloadrsync and ssh don't prompt for a password, because I have DSA encryption... (9 Replies)
Discussion started by: fluoborate
9 Replies

4. UNIX for Dummies Questions & Answers

CentOS using sudo command

Hi, this is my first time posting here and am new to linux/unix. So here is my question. I have two user account and a root account. root user account 1:calchen1 user account2: calchen2 Now i want to use the sudo utility to allows user to run programs with the privileges of another... (1 Reply)
Discussion started by: coolcalin812
1 Replies

5. UNIX for Dummies Questions & Answers

Unable to use the Sudo command. "0509-130 Symbol resolution failed for sudo because:"

Hi! I'm very new to unix, so please keep that in mind with the level of language used if you choose to help :D Thanks! When attempting to use sudo on and AIX machine with oslevel 5.1.0.0, I get the following error: exec(): 0509-036 Cannot load program sudo because of the following errors:... (1 Reply)
Discussion started by: Chloe123
1 Replies

6. Shell Programming and Scripting

shell script problem , sudo mount command

cat test.sh sudo mount -t vfat /dev/sda7 /media/Ddrive If i double click the test.sh file and select run in terminal then the terminal prompts for password. How can i avoid typing password? Or if i double click test.sh file and select run then nothing happens. What i'm trying "Double... (3 Replies)
Discussion started by: cola
3 Replies

7. UNIX for Advanced & Expert Users

Sudo command

Hello, What does the below sudo command provide access to, does it allow a user to su to any other user except root. sudo !/usr/bin/su * (1 Reply)
Discussion started by: sophos
1 Replies

8. UNIX for Advanced & Expert Users

Sudo command problem

Hi All, I am tring to redirect mails comming to my user id to a script. In other word trigger a script when a mail comes to my user id. Actually , Admin team has done all this to me previously. in my script i am doing like /usr/local/bin/sudo -u parbrxs /export/home/parbrxs/bin/parbrxs.sh... (4 Replies)
Discussion started by: mindtee_abhi
4 Replies

9. Shell Programming and Scripting

sudo command is not working inside a script when placed in cron

Hi All, i have a cron entry like 0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /amex/sssmonitor/dss_chk.ksh and the script is like #!/bin/ksh file=`uname -n` > /sunmast/projects/oasis/COREDEV/Dss$file.log > /tmp/output_sss today=`date` varb=`ps -ef | grep... (5 Replies)
Discussion started by: usha rao
5 Replies

10. Solaris

Sudo for a command

I am trying to set up sudo for a command, but do not want to specify the arguments that can be passed into it. I want the user who is using sudo to be able to pass in the arguments they want. I am fairly sure I know how to do this with RBAC in Solaris 10, but for reasons I will not get into I... (1 Reply)
Discussion started by: synchro
1 Replies
Login or Register to Ask a Question