Sponsored Content
Full Discussion: Run sudo to another user
Operating Systems AIX Run sudo to another user Post 302407930 by Mr.AIX on Saturday 27th of March 2010 06:17:35 AM
Old 03-27-2010
Run sudo to another user

Run sudo to another user .

I have two users in my AIX system appadmin (Application admin ) and appuser (Application user)
Application Admin user has special permission to run every thing about this application.

I have one script called /usr/app.sh
Only appadmin has permission to run this script
by sudo I want to let appuser to be able to run this script

by root I have configured the system as the following

visudo
%appuser ALL=( appadmin) /usr/app.sh

As per the above configuration appuser should has permission to run sudo and it should to execute that script
When appuser login to the system and when he type sudo –l

User appuser may run the following commands on this host:
(appuser) /usr/app.sh

Everything is ok till now .. but when he try to execute that command by sudo he will got the below

$ sudo /usr/app.sh
Sorry, user appuser is not allowed to execute '/usr/app.sh' as root on Appserver.

why it saying as root I configured sudo to run that script by appadmin and why is not allowed to execute that sicript !


Pls advice in this …


.

Last edited by Mr.AIX; 03-27-2010 at 07:29 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sudo not allow User to run sed

Hello, As recommended by the moderators I will start my questions here... I am a little confused by my Linux (CentOS/RHEL) distribution's sudo mechanism. Or perhaps I just do not know how to use sudo. I can run a sed command as the root user but it fails to write a root-owned directory... (6 Replies)
Discussion started by: duderonomy
6 Replies

2. UNIX for Dummies Questions & Answers

sudo user

I am trying to run a command from different user on my server. However when i execute the command it asks for password can you please help. when i use this command to switch user no password is required 1) sudo su - bilbtf42 when i use 2) sudo su - bilbtf42 cp file1 direcotry1/file1 ... (3 Replies)
Discussion started by: blackeyed
3 Replies

3. Cybersecurity

Unable to run 'su' and 'sudo' after changing permissions on /etc

Hello, I'm running rhel6 64bit. Accidentally I ran % chmod -R 777 /etc and after that I have a problem to do 'su' or 'sudo'. When I did sudo it complained that /etc/sudoers has 777 while it should be 0440. I changed that and also restored right permission for: -rw-r--r-- 1 root root 1966 May 19... (2 Replies)
Discussion started by: susja
2 Replies

4. Shell Programming and Scripting

sudo: sorry, you must have a tty to run sudo

Hi All, I running a unix command using sudo option inside shell script. Its working well. But in crontab the same command is not working and its throwing "sudo: sorry, you must have a tty to run sudo". I do not have root permission to add or change settings for my userid. I can not even ask... (9 Replies)
Discussion started by: Apple1221
9 Replies

5. 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

6. Shell Programming and Scripting

sudo: sorry, you must have a tty to run sudo

Hi, Have a need to run the below command as a "karuser" from a java class which will is running as "root" user. When we are trying to run the below command from java code getting the below error. Command: sudo -u karuser -s /bin/bash /bank/karunix/bin/build_cycles.sh Error: sudo: sorry,... (8 Replies)
Discussion started by: Satyak
8 Replies

7. 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

8. Shell Programming and Scripting

Chmod working in sudo run script but chown isn't

My git user has permission in sudoers to run a wrapper script to move files into my webroot. Everything is working fine except for the chown line. After the script has run, the files ar still root:root instead of apache:apache. Scratching my head...:confused: #!/bin/sh echo echo "****... (4 Replies)
Discussion started by: dheian
4 Replies

9. Shell Programming and Scripting

Preserving variable in script run with sudo

In a nutshell, I want $USER to reflect my user ID in a script run with sudo. I'm working with OSX in case that makes a difference. If I 'sudo echo $USER', I get my user ID. But if I 'sudo myscript.sh' and myscript.sh has a line to echo $USER, I get 'root' I'm hoping there's a switch I can add... (1 Reply)
Discussion started by: jnojr
1 Replies

10. Shell Programming and Scripting

How to automatically run commands after SSH and SUDO not working?

I'm working on a script to SSH and SUDO as (sap user sidadm) then automatically run commands that the sidadm user can run such as R3trans -v, tp, etc.. I can SSH without password and SUDO.. but the commands don't run after I SSH and SUDO to the sidadm user...here is the commands that I've... (2 Replies)
Discussion started by: icemanj
2 Replies
CGI
::Application::Plugin::Authorization::Driver::SimpleGUser(Contributed Perl DocCGI::Application::Plugin::Authorization::Driver::SimpleGroup(3pm) NAME
CGI::Application::Plugin::Authorization::Driver::SimpleGroup - Simple Group based Authorization driver SYNOPSIS
use base qw(CGI::Application); use CGI::Application::Plugin::Authorization; __PACKAGE__->authz->config( DRIVER => [ 'SimpleGroup' ], # You are responsible for setting a group param somehow! GET_USERNAME => sub { my $authz = shift; return $authz->cgiapp->session->param('group') }, ); DESCRIPTION
This driver achieves simplicity by assuming that the "username" method of CGI::Application::Plugin::Authorization will return a group rather than a username. Thus it can be directly compared with the list of authorized groups passed to authorize EXAMPLE
use base qw(CGI::Application); use CGI::Application::Plugin::Authorization; __PACKAGE__->authz->config( DRIVER => [ 'SimpleGroup' ], # You are responsible for setting a group param somehow! GET_USERNAME => sub { my $authz = shift; return $authz->cgiapp->session->param('group'); }, ); sub cgiapp_prerun { my $self = shift; # here is an example of how you could set the # group param that will be tested later if ($ENV{REMOTE_USER} eq 'mark') { $self->session->param('group' => 'admin'); } } sub my_runmode { my $self = shift; # make sure the user has 'admin' privileges return $self->authz->forbidden unless $self->authz->authorize('admin'); # if we get here the user has 'admin' privileges } METHODS
authorize_user This method is not intended to be used directly. Just follow the SYNOPSIS. This method accepts a username followed by a list of group names and will return true if the user belongs to at least one of the groups. SEE ALSO
CGI::Application::Plugin::Authorization::Driver, CGI::Application::Plugin::Authorization, perl(1) LICENCE AND COPYRIGHT
Copyright (c) 2006, Mark Stosberg. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.12.3 2011-05-04 CGI::Application::Plugin::Authorization::Driver::SimpleGroup(3pm)
All times are GMT -4. The time now is 03:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy