sudo / user - profile question
eric_forgette at vapower.com
eric_forgette at vapower.com
Wed Feb 16 12:36:00 EST 2000
From: Todd C. Miller at Todd.Miller on 02/15/2000 03:49 PM
To: eric forgette/COMMOPS/VANCPOWER at VANCPOWER
cc: sudo-users at sudo-users@courtesan.com at SMTP@Exchange
Subject: Re: sudo / user - profile question
In message <85256886.0071B173.00 at smtpmta.vapower.com>
so spake (forgettee):
> Quick sudo question...
> How can I get the .profile to source automatically when a user sudos to anoth
> er
> user?
> The example below doesn't cause the .profile to execute.
> sudo -H -u user2 /usr/bin/ksh
Ksh only source .profile if the shell name starts with a '-' or
the -l option is given, so:
sudo -H -u user2 /usr/bin/ksh -l
should do the trick.
- todd
Todd - Thanks for the quick response.
I should have provided more information.
I am running sudo on a Solaris 2.6 box. The -l is not available.
In fact the man page states that ksh should always source the .profile.
There is a -p option to prevent the .profile from being executed. I can use the
"-" in
the case of:
su - user2
How could I get the "-" to work with sudo? Any ideas?
Thanks,
Eric
More information about the sudo-users
mailing list