Click here to get back home

Remote.pm (File::Remote) problem

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Remote.pm (File::Remote) problem Dayton Jones 02-28-2006
Posted by Dayton Jones on February 28, 2006, 9:50 pm
Please log in for more thread options


I've got a very simple script (see below) that uses the File::Remote
module. I've set up the script to use ssh/scp and there is no problem
for the user to ssh to the hosts - but the script fails with a
"permission denied" error on the copy command.

-- begin script

#!/usr/bin/perl
use File::Remote qw(:replace);

setrsh('/usr/bin/ssh');
serrcp('/usr/bin/scp');
settmp('/tmp');

copy("host1:/tmp/file","host1:/tmp/file2") or die ":: $!\n";

-- end script

On "host1" I can see the connection coming in:
        Feb 28 18:46:48 host1 sshd(pam_unix)[20211]: session opened for user
XXXX by (uid=XXX)
        Feb 28 18:46:49 host1 sshd(pam_unix)[20211]: session closed for user XXXX


So I don't know what is causing the permissions issue... Any ideas or
suggestions? What do I need to look at, what could be the cause?

Thanks is advance for any help...

Posted by A. Sinan Unur on February 28, 2006, 10:04 pm
Please log in for more thread options



> I've got a very simple script (see below) that uses the File::Remote
> module. I've set up the script to use ssh/scp and there is no problem
> for the user to ssh to the hosts - but the script fails with a
> "permission denied" error on the copy command.
>
> -- begin script
>
> #!/usr/bin/perl

use strict;
use warnings;

missing.

> use File::Remote qw(:replace);
>
> setrsh('/usr/bin/ssh');
> serrcp('/usr/bin/scp');

*Ah-em*. Have you read the posting guidelines for this group?

...

> Thanks is advance for any help...

You can learn how to help others help you, and also how to help yourself
by following the posting guidelines.

Sinan

--
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


Posted by Dayton Jones on February 28, 2006, 10:46 pm
Please log in for more thread options


Sorry, no I hadn't read the guidelines but I will now.

I added the strict/warnings but had the same result -- with no extra
information.

A. Sinan Unur wrote:
>
>
>>I've got a very simple script (see below) that uses the File::Remote
>>module. I've set up the script to use ssh/scp and there is no problem
>>for the user to ssh to the hosts - but the script fails with a
>>"permission denied" error on the copy command.
>>
>>-- begin script
>>
>>#!/usr/bin/perl
>
>
> use strict;
> use warnings;
>
> missing.
>
>
>>use File::Remote qw(:replace);
>>
>>setrsh('/usr/bin/ssh');
>>serrcp('/usr/bin/scp');
>
>
> *Ah-em*. Have you read the posting guidelines for this group?
>
> ...
>
>
>>Thanks is advance for any help...
>
>
> You can learn how to help others help you, and also how to help yourself
> by following the posting guidelines.
>
> Sinan
>

Posted by A. Sinan Unur on February 28, 2006, 10:57 pm
Please log in for more thread options



> A. Sinan Unur wrote:
>>
>>
>>>I've got a very simple script (see below) that uses the File::Remote
>>>module. I've set up the script to use ssh/scp and there is no
>>>problem for the user to ssh to the hosts - but the script fails with
>>>a "permission denied" error on the copy command.
>>>
>>>-- begin script
>>>
>>>#!/usr/bin/perl
>>
>>
>> use strict;
>> use warnings;
>>
>> missing.
>>
>>
>>>use File::Remote qw(:replace);
>>>
>>>setrsh('/usr/bin/ssh');
>>>serrcp('/usr/bin/scp');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...

> I added the strict/warnings but had the same result -- with no extra
> information.

Well, did you fix the typo above?

I don't have File-Remote installed, by I doubt serrcp is correct.

Sinan

--
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


Posted by Dayton Jones on February 28, 2006, 11:02 pm
Please log in for more thread options


Yes, I noticed that when reading your original response -- changed it to
"setrcp="

A. Sinan Unur wrote:
>
>
>>A. Sinan Unur wrote:
>>
>>>
>>>
>>>
>>>>I've got a very simple script (see below) that uses the File::Remote
>>>>module. I've set up the script to use ssh/scp and there is no
>>>>problem for the user to ssh to the hosts - but the script fails with
>>>>a "permission denied" error on the copy command.
>>>>
>>>>-- begin script
>>>>
>>>>#!/usr/bin/perl
>>>
>>>
>>>use strict;
>>>use warnings;
>>>
>>>missing.
>>>
>>>
>>>
>>>>use File::Remote qw(:replace);
>>>>
>>>>setrsh('/usr/bin/ssh');
>>>>serrcp('/usr/bin/scp');
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ...
>
>
>>I added the strict/warnings but had the same result -- with no extra
>>information.
>
>
> Well, did you fix the typo above?
>
> I don't have File-Remote installed, by I doubt serrcp is correct.
>
> Sinan
>

Similar ThreadsPosted
Remote.pm (File::Remote) error handling question January 29, 2007, 12:57 pm
remote file copy using Net::Telnet February 3, 2006, 2:02 am
remote keyboard and mouse IO February 21, 2005, 3:22 am
how to execute command on remote machine September 21, 2005, 12:40 am
Remote install of Perl Module April 12, 2005, 10:47 am
Read user log from a remote host July 26, 2006, 5:14 am
Net::SSH::Perl to connect to a remote server via a web page August 30, 2004, 10:02 am
SOAP::Lite creating remote objects March 29, 2006, 9:51 am
SOAP::WSDL error accessing remote site. July 19, 2007, 3:14 am
Is there a module that grabs a remote page and prints thumbnail image? May 26, 2006, 12:09 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap