linux - No connection as non root using Net::SFTP::Foreign -



linux - No connection as non root using Net::SFTP::Foreign -

i trying utilize perl script transfer files 1 machine within cron job. security reasons cron job has run unprivileged user. if seek found connection using unpriviliged user, net::sftp::foreign refuses connect. here part of script having problem with:

my $host = "hostname"; %args = ( user => "username", password => "password", port => '12345' ); $sftp_connection = net::sftp::foreign->new($host, %args); if( $sftp_connection->error ) { log_message( "e", "error " . $sftp_connection->status() . " connecting " . $host ); die; } log_message( "a", "connected" );

i cannot give total example, require username , password.

if execute script root, works fine, if seek utilize user, connection fails.

is there way more diagnostic information? think there way more output actual sftp process, cannot right cpan not work here.

i tried using net::sftp instead of net::sftp, error handling @ later parts did not work correctly, switching net::sftp not seem viable alternative right now.

use metacpan.org

debugging:

for debugging purposes can run ssh in verbose mode passing -v option: my $sftp = net::sftp::foreign->new($host, more => '-v');

"module description"

linux perl sftp

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -