RE: [Ssh-sftp-perl-users] Running a Net::SSH::Perl script via a W eb server
Brought to you by:
dbrobins
From: Ari G. <ar...@su...> - 2005-08-25 21:24:13
|
Big thanks to Vladimir for this one, it sure is less then the few lines of code I wrote to do the same thing. Just as an update to this, it's starting to look like this may really be a systems issue (at least on my side) and not really the Net::SSH:Perl module. The process which calls the script for me is owned by one user, but that process is a child process of one that is owned by root. So what it looks like is that even though the UID is that of one user, the shell is that of root's. Similar to the difference between doing an: su - username (where you inherit username's shell) versus su username (where you don't inherit....) And so that's seems to be why we need to reset the HOME env var, so that the proper known_hosts file is accessed. Regards, Ari -----Original Message----- From: Vladimir Parkhaev [mailto:vla...@ar...] Sent: Thursday, August 25, 2005 9:55 AM To: Ari Gurewitz Cc: ssh...@li... Subject: Re: [Ssh-sftp-perl-users] Running a Net::SSH::Perl script via a W eb server I am too lazy to research why.... Quick solution is: $ENV{HOME}=(getpwuid $<)[7]; Quoting Ari Gurewitz (ar...@su...): > That's basically what we've done as well, but since we want to distribute > this script to multiple servers, and based on different server configs the > script may be run as different users - so while we can add more code in the > script to change the HOME environment variable based on the user that is > running the script (and maybe then reading /etc/passwd to determine the > proper home dir) it would be nice to not have to deal with this (or at least > to better understand it) - so, if anyone has more insight as to how or why > this variable is changed, or maybe if there is some other setting that would > address this I'd be interested in hearing about it. > > Thanks, > Ari -- .signature: No such file or directory |