Add sudo executable commands


 
Thread Tools Search this Thread
Operating Systems AIX Add sudo executable commands
# 1  
Old 01-20-2010
Add sudo executable commands

Guy's

I have sudo already installed in AIX , just I want to know how can I add for example the following commands to be executed by sudo by (appuser)..

shutdown
/usr/startapp.sh
/usr/stopapp.sh
ITHelper
# 2  
Old 01-20-2010
Add a line like the following to your sudoers file using visudo:
Code:
appuser ALL = (ALL) shutdown, /usr/startapp.sh, /usr/stopapp.sh

The syntax is always:
Code:
user host = (other) [option] command

where
  • user is the user that should be allowed to run these commands
  • host is the host where this should be allowed, in case you use the same sudoers file on multiple hosts. ALL means any host
  • other is the user that these commands may be run as. So if you want to allow an user to run a program as www-data, put that name there. ALL means any user.
  • option is a modifier, most common is NOPASSWD to disable asking for passwords. See the sudoers man page for more details
  • command is a comma-separated list of commands, as detailed as you like, of programs this user may run.

See the sudoers man page for more details
# 3  
Old 01-23-2010
Thanks for your replay I configured it by sudo Smilie...


Another thing and before I do that , I'm planning to apply this command by sudo errclear 0

is it possible to make an errclear.sh then I'll type inside it errclear 0
is it good way to mentioned this file \root\errclear.sh in sudo to be executable or can I execute this direct command errclear 0....



And can you please give me the software of sudo !
ITHelper
# 4  
Old 01-23-2010
In the sudoers file you can specify commands to and level of detail you want, eg. the entry
  • mount would allow any command named such, no matter where
  • /sbin/mount would only allow that command when specified with the complete path
  • /sbin/mount -t nfs 1.2.3.4:/export /import would only allow this exact command, and no derivation from it
Quote:
Originally Posted by ITHelper
And can you please give me the software of sudo !
What do you mean by that? According to your first post, you've already got it installed.
# 5  
Old 01-23-2010
Yes.. I want the software best version and if you have any direct link to download it please provide !
ITHelper
# 6  
Old 01-23-2010
The official site (as far as I can see) is here. The Download page lists 3 different sites holding packages for AIX, including one at IBM itself.

Total search time, from loading Google to the Download page at IBM: 30 seconds.
Total time to write this post: 1 minute.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to create an executable bash script for these commands?

I wish to create an executable bash script that will run the following commands as root, that is, using sudo su iptables-save | awk '/^ / { print $1 } /^:+ / { print $1 " ACCEPT" ; } /COMMIT/ { print $0; }' | iptables-restoreMy first attempt at bash... (9 Replies)
Discussion started by: thixeqi
9 Replies

2. Ubuntu

Sudo commands without puting in .bashrc

dear all, When I start my laptop, I need to run one command /etc/init.open-afs start and it require sudo privilege. The only solution which occur to me is to put this command in .bashrc. But then the trouble comes as everytime I open any new tab it ask for the sudo password, which is pretty... (5 Replies)
Discussion started by: emily
5 Replies

3. Shell Programming and Scripting

Ssh not supporting sudo and sqlplus commands

Hi Guys , I was facing an issue some thing like , I have to connect remote machine and should execute few commands over there , I am able to run some simple commands , but below commands are throws error like not found. eg : sudo su - username and sqlplus user/pwd@db , srvrmgr commands etc ... (8 Replies)
Discussion started by: chandini
8 Replies

4. Shell Programming and Scripting

How to run sudo commands under a script?

Hi, I am new to scripting. I am trying to write a script to ssh one remote machine and run a sudo command. ssh <hostname> sudo -S <command> < ~/pass.txt I am stored my password in pass.txt. I am getting error sudo: no tty present and no askpass program specified Please suggest me how can... (1 Reply)
Discussion started by: venkia9
1 Replies

5. UNIX for Dummies Questions & Answers

[Solved] About commands for linux executable files

I have seen commands like this: (hello is the executable file or maybe script file) ./hello hello .hello So, anyone could tell me the differences among these commands? (2 Replies)
Discussion started by: icyfight
2 Replies

6. AIX

track commands run as root after sudo

I'm looking for a way to track commands that are run as root after a user runs sudo su - root. I have a profile set up for root that will track the commands by userid but if we change the shell it only stores it in that shells history file. (2 Replies)
Discussion started by: toor13
2 Replies

7. UNIX for Advanced & Expert Users

sudo: blocking specific commands

Hello all, I manage some HP-UX 11.31 servers. I have some users that have sudo access. All of them belong to the 'sudoers' user group. Right now, sudo is configured as wide open: %sudoers ALL=(ALL) ALL We are using sudo mostly for auditing purposes - when a user wants to run a... (9 Replies)
Discussion started by: lupin..the..3rd
9 Replies

8. Programming

Using Commands over SSH using Sudo

Is there a way to transfer my sudo password via ssh so that I can copy files remotely and pass them locally, so: cat sudo-passwd-file|ssh -t user@10.7.0.180 'sudo find / -depth|cpio -oacv|gzip' > /path/to/dir/file.cpio.gz I am in the process of a creating a script. Everytime I try and just... (16 Replies)
Discussion started by: metallica1973
16 Replies

9. UNIX for Dummies Questions & Answers

sudo commands list

Hi, Can you please give me a list of commands executed through 'sudo' command, thank you. (1 Reply)
Discussion started by: Dev_Dev
1 Replies

10. UNIX for Advanced & Expert Users

Logging all commands after a sudo su-

Hi there, It might seem tricky, I confess. We use sudo to allow people to initiate priviledged commands (but not all commands) on our Unix systems. To by pass this, some people initiate the sudo su - command ; The main issue is to 'know' what those people do when they gain root access.... (4 Replies)
Discussion started by: linuxmtl
4 Replies
Login or Register to Ask a Question