Nedd help with sudo - Aix
This is a discussion on Nedd help with sudo - Aix ; Folks,
I am running Sudo version 1.6.8p9 on a AIX 5.3 system. I created entry in
the sudoers file so that one user (user1) can run the command as another
user (user2) without any password using NOPASSWD tag. I am ...
-
Nedd help with sudo
Folks,
I am running Sudo version 1.6.8p9 on a AIX 5.3 system. I created entry in
the sudoers file so that one user (user1) can run the command as another
user (user2) without any password using NOPASSWD tag. I am able to run
command as follows without begin asked for password:
user1$ sudo -u user2 command
the command does not run properly because certain environment variable are
not set, these variable are set when user logs in, so I tried to use "-i"
option to simulate login, but sudo asks for password when I use "-i"
option:
user1$ sudo -i -u user2 command
Password:
How do I setup sudo so that I can use "-i" and NOPASSWD together?
Thanks.
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: NoJunkMailshah@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
-
Re: Nedd help with sudo
On Mar 28, 1:24 pm, Hemant Shah wrote:
> Folks,
>
> the command does not run properly because certain environment variable are
> not set, these variable are set when user logs in, so I tried to use "-i"
> option to simulate login, but sudo asks for password when I use "-i"
> option:
>
> user1$ sudo -i -u user2 command
> Password:
>
> How do I setup sudo so that I can use "-i" and NOPASSWD together?
Why not wrap "command" in a script that sets the correct environment
variables?
-
Re: Nedd help with sudo
While stranded on information super highway John Hoover wrote:
> On Mar 28, 1:24 pm, Hemant Shah wrote:
>> Folks,
>>
>
>> the command does not run properly because certain environment variable are
>> not set, these variable are set when user logs in, so I tried to use "-i"
>> option to simulate login, but sudo asks for password when I use "-i"
>> option:
>>
>> user1$ sudo -i -u user2 command
>> Password:
>>
>> How do I setup sudo so that I can use "-i" and NOPASSWD together?
>
>
> Why not wrap "command" in a script that sets the correct environment
> variables?
That is exactly what I had to do. It looks like sudo does not like
"-i" and NOPASSWD option.
>
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: NoJunkMailshah@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.