[YLUG] Re: Help please: running scripts remotely / ssh and suid

Robert Hulme rob at robhulme.com
Fri Jul 13 14:45:43 BST 2007


> Where I work we have an Oracle server which a DBA has a login on but
> the developers do not have a login on.
OK, sorry for spamming everyone, but I've solved it... :-P

You can use perl to change the effective uid as follows:

#!/usr/bin/perl
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
$ENV{PATH}='/bin:/usr/bin';

# Set real and effective uids
my $uid = getpwnam("dba");
$> = $uid;
$< = $uid;

system('ssh -i /home/dba/.ssh/id_dsa oracleserver "mkdir foo"')


-- 
http://www.robhulme.com/
http://robhu.livejournal.com/

Every nation in every region now has a decision to make. Either you
are with us, or you are with the terrorists.
-- George W Bush, echoing the either-or, black-and-white thinking
practiced by the Jesus character of the Christian Gospel stories ("He
that is not with me is against me; and he that gathereth not with me
scattereth abroad." -- Matthew 12:30)



More information about the York mailing list