in reply to Secure upload without account in remote server

So first i tried with Net::SCP, but if runned it with setuid in user X rights, it could access server, but not users Homes. And if runned it with setgid, it has access to local homes, but can't access remote server. Main problem: i did not get Net::SCP to use user X's identity files.

This should be easy to solve, divide and conquer

$ cat wanradtXXX.pl #!/usr/bin/perl -- use autodie; ## system $^X, 'wanradtXXX.pl', '--ReadImages'; ## system $^X, 'wanradtXXX.pl', '--UploadImages'; system $^X, 'wanradtXXXReadImages.pl'; system $^X, 'wanradtXXXUploadImages.pl';

Oh, and BTW, I hear suidperl doesn't exist anymore :)

Replies are listed 'Best First'.
Re^2: Secure upload without account in remote server
by wanradt (Scribe) on Dec 15, 2010 at 15:52 UTC

    Thank you, i get rid of suidperl. But i have some "thinking" bug in power. So, i can't make a script which scp-s files to remote server in other user rights. Should i?

    Minimized script:

    #!/usr/bin/perl use strict; use warnings; use Net::SCP qw( scp iscp ); my $scp = Net::SCP -> new( '192.168.1.3', 'X' ); $scp->put( 'file.jpg' ) or die $scp->{errstr};

    Even showing effective user (with POSIX) and effective group as user X and needed group, scp is still runned under runner user. (This i guess, because i don't see any debugging interface in Net::SCP. And if i try make scp with "system 'scp -v ...'" i see it still does not use setuid/setgid)

    So i still have no solution to scp files to remote server without explicitly giving permissions to users.
    Nġnda, WK