SCP putting file problem
am 16.10.2007 21:51:10 von lerameur
hello,
I am getting an error while I am using the SCP put command:
here is the error:
Use of uninitialized value in die at ./spam_parsing.pl line 259,
line 2.
Died at ./spam_parsing.pl line 259, line 2.
from the line code 259:
$SCP->put("$file_to_put") or die SCP->{"errstr"};
print "Putting file and quitting \n";
It is logging in fine but the script exits when it reaches this
command.
I did put a print out to the "$file_to_put " file right before the
$SCP->put(".. line and it prints out fine, so the file is not a
problem.
anyone has an idea?
k
Re: SCP putting file problem
am 16.10.2007 21:55:53 von glex_no-spam
lerameur wrote:
> hello,
>
> I am getting an error while I am using the SCP put command:
>
> here is the error:
> Use of uninitialized value in die at ./spam_parsing.pl line 259,
> line 2.
> Died at ./spam_parsing.pl line 259, line 2.
>
> from the line code 259:
> $SCP->put("$file_to_put") or die SCP->{"errstr"};
^$SCP
[...]
> anyone has an idea?
Add the following to the top of your script:
use strict;
Re: SCP putting file problem
am 16.10.2007 22:03:15 von Ron Bergin
On Oct 16, 12:51 pm, lerameur wrote:
> hello,
>
> I am getting an error while I am using the SCP put command:
>
> here is the error:
> Use of uninitialized value in die at ./spam_parsing.pl line 259,
> line 2.
> Died at ./spam_parsing.pl line 259, line 2.
>
> from the line code 259:
> $SCP->put("$file_to_put") or die SCP->{"errstr"};
Shouldn't that be:
$SCP->put($file_to_put) or die $SCP->{errstr};
> print "Putting file and quitting \n";
>
> It is logging in fine but the script exits when it reaches this
> command.
>
> I did put a print out to the "$file_to_put " file right before the
> $SCP->put(".. line and it prints out fine, so the file is not a
> problem.
> anyone has an idea?
>
> k
Re: SCP putting file problem
am 16.10.2007 22:27:44 von lerameur
On Oct 16, 4:03 pm, Ron Bergin wrote:
> On Oct 16, 12:51 pm, lerameur wrote:
>
> > hello,
>
> > I am getting an error while I am using the SCP put command:
>
> > here is the error:
> > Use of uninitialized value in die at ./spam_parsing.pl line 259,
> > line 2.
> > Died at ./spam_parsing.pl line 259, line 2.
>
> > from the line code 259:
> > $SCP->put("$file_to_put") or die SCP->{"errstr"};
>
> Shouldn't that be:
> $SCP->put($file_to_put) or die $SCP->{errstr};
>
> > print "Putting file and quitting \n";
>
> > It is logging in fine but the script exits when it reaches this
> > command.
>
> > I did put a print out to the "$file_to_put " file right before the
> > $SCP->put(".. line and it prints out fine, so the file is not a
> > problem.
> > anyone has an idea?
>
> > k
I tried both with and without quote and I get the same error message
k
Re: SCP putting file problem
am 16.10.2007 22:28:16 von lerameur
On Oct 16, 4:03 pm, Ron Bergin wrote:
> On Oct 16, 12:51 pm, lerameur wrote:
>
> > hello,
>
> > I am getting an error while I am using the SCP put command:
>
> > here is the error:
> > Use of uninitialized value in die at ./spam_parsing.pl line 259,
> > line 2.
> > Died at ./spam_parsing.pl line 259, line 2.
>
> > from the line code 259:
> > $SCP->put("$file_to_put") or die SCP->{"errstr"};
>
> Shouldn't that be:
> $SCP->put($file_to_put) or die $SCP->{errstr};
>
> > print "Putting file and quitting \n";
>
> > It is logging in fine but the script exits when it reaches this
> > command.
>
> > I did put a print out to the "$file_to_put " file right before the
> > $SCP->put(".. line and it prints out fine, so the file is not a
> > problem.
> > anyone has an idea?
>
> > k
I tried both with and without quote and I get the same error message
k
Re: SCP putting file problem
am 16.10.2007 22:36:02 von lerameur
On Oct 16, 4:28 pm, lerameur wrote:
> On Oct 16, 4:03 pm, Ron Bergin wrote:
>
>
>
> > On Oct 16, 12:51 pm, lerameur wrote:
>
> > > hello,
>
> > > I am getting an error while I am using the SCP put command:
>
> > > here is the error:
> > > Use of uninitialized value in die at ./spam_parsing.pl line 259,
> > > line 2.
> > > Died at ./spam_parsing.pl line 259, line 2.
>
I added
use strict;
here is the error message I am getting:
Can't use bareword ("SCP") as a HASH ref while "strict refs" in use
at ./spam_parsing.pl line 289.
k
Re: SCP putting file problem
am 16.10.2007 22:43:42 von Ron Bergin
On Oct 16, 1:27 pm, lerameur wrote:
> On Oct 16, 4:03 pm, Ron Bergin wrote:
>
>
>
> > On Oct 16, 12:51 pm, lerameur wrote:
>
> > > hello,
>
> > > I am getting an error while I am using the SCP put command:
>
> > > here is the error:
> > > Use of uninitialized value in die at ./spam_parsing.pl line 259,
> > > line 2.
> > > Died at ./spam_parsing.pl line 259, line 2.
>
> > > from the line code 259:
> > > $SCP->put("$file_to_put") or die SCP->{"errstr"};
>
> > Shouldn't that be:
> > $SCP->put($file_to_put) or die $SCP->{errstr};
>
> > > print "Putting file and quitting \n";
>
> > > It is logging in fine but the script exits when it reaches this
> > > command.
>
> > > I did put a print out to the "$file_to_put " file right before the
> > > $SCP->put(".. line and it prints out fine, so the file is not a
> > > problem.
> > > anyone has an idea?
>
> > > k
>
> I tried both with and without quote and I get the same error message
>
> k
The quote is not the key issue. You forgot the $
Look closely at the difference between these:
die SCP->{"errstr"}
die $SCP->{"errstr"}
Re: SCP putting file problem
am 17.10.2007 00:52:19 von Paul Lalli
On Oct 16, 3:51 pm, lerameur wrote:
> hello,
>
> I am getting an error while I am using the SCP put command:
>
> here is the error:
> Use of uninitialized value in die at ./spam_parsing.pl line 259,
> line 2.
> Died at ./spam_parsing.pl line 259, line 2.
>
> from the line code 259:
> $SCP->put("$file_to_put") or die SCP->{"errstr"};
You need to reread the Net::SCP documentation better.
>From http://search.cpan.org/~ivan/Net-SCP-0.07/SCP.pm
$scp->get("filename") or die $scp->{errstr};
$scp->put("filename") or die $scp->{errstr};
Paul Lalli
Re: SCP putting file problem
am 17.10.2007 02:43:02 von lerameur
On Oct 16, 6:52 pm, Paul Lalli wrote:
> On Oct 16, 3:51 pm, lerameur wrote:
>
> > hello,
>
> > I am getting an error while I am using the SCP put command:
>
> > here is the error:
> > Use of uninitialized value in die at ./spam_parsing.pl line 259,
> > line 2.
> > Died at ./spam_parsing.pl line 259, line 2.
>
> > from the line code 259:
> > $SCP->put("$file_to_put") or die SCP->{"errstr"};
>
> You need to reread the Net::SCP documentation better.>Fromhttp://search.cpan.org/~ivan/Net-SCP-0.07/SCP.pm
>
> $scp->get("filename") or die $scp->{errstr};
> $scp->put("filename") or die $scp->{errstr};
>
> Paul Lalli
well I fixed the perl problem, forgot the $ like Ron mentionned
I am faced with another problem
I am getting this error message. This is a non perl issue.
Permission denied (publickey,password,keyboard-interactive).
I followed the tutorial on this link:
http://rcsg-gsir.imsb-dsgi.nrc-cnrc.gc.ca/documents/internet /node31.html
and also from other post here a few days ago.
but I still get the error message.
I created a key in .ssh/id_rsa.pub and copy that into the .ssh/
known_hosts in the receiving server
any help appreciated
thanks
ken
Re: SCP putting file problem
am 17.10.2007 11:35:38 von unknown
Post removed (X-No-Archive: yes)
Re: SCP putting file problem
am 17.10.2007 11:55:53 von Polleke
all mail refused schreef:
> On 2007-10-17, lerameur wrote:
>
>> http://rcsg-gsir.imsb-dsgi.nrc-cnrc.gc.ca/documents/internet /node31.html
>> and also from other post here a few days ago.
>> but I still get the error message.
>> I created a key in .ssh/id_rsa.pub and copy that into the .ssh/
>> known_hosts in the receiving server
>
> You seem to have confused host keys with user keys.
>
> On the client side: "ssh-keygen -t dsa"
> and copy "id_dsa" to (on the server side) ".ssh/authorized_keys" .
^^^^^^
You mean id_dsa.pub :)
I wouldn't like it if anyone had my private key...
Paul
Re: SCP putting file problem
am 17.10.2007 13:39:17 von lerameur
On Oct 17, 11:55 am, Paul wrote:
> all mail refused schreef:> On 2007-10-17, lerameur wrote:
>
> >>http://rcsg-gsir.imsb-dsgi.nrc-cnrc.gc.ca/documents/intern et/node31.html
> >> and also from other post here a few days ago.
> >> but I still get the error message.
> >> I created a key in .ssh/id_rsa.pub and copy that into the .ssh/
> >> known_hosts in the receiving server
>
> > You seem to have confused host keys with user keys.
>
> > On the client side: "ssh-keygen -t dsa"
> > and copy "id_dsa" to (on the server side) ".ssh/authorized_keys" .
>
> ^^^^^^
>
> You mean id_dsa.pub :)
>
> I wouldn't like it if anyone had my private key...
>
> Paul
well I do not see .ssh/authorized_keys but I do see /dir/.ssh/
known_hosts
I also have a directory /.ssh/known_hosts but this is root access
only and I tried puttingin both places my public key but that never
worked
k
Re: SCP putting file problem
am 17.10.2007 13:51:34 von Josef Moellers
lerameur wrote:
> On Oct 17, 11:55 am, Paul wrote:
>=20
>>all mail refused schreef:> On 2007-10-17, lerameur =
wrote:
>>
>>
>>>>http://rcsg-gsir.imsb-dsgi.nrc-cnrc.gc.ca/documents/inte rnet/node31.h=
tml
>>>>and also from other post here a few days ago.
>>>>but I still get the error message.
>>>>I created a key in .ssh/id_rsa.pub and copy that into the .ssh/
>>>>known_hosts in the receiving server
>>
>>>You seem to have confused host keys with user keys.
>>
>>>On the client side: "ssh-keygen -t dsa"
>>>and copy "id_dsa" to (on the server side) ".ssh/authorized_keys" .
>>
>> ^^^^^^
>>
>>You mean id_dsa.pub :)
>>
>>I wouldn't like it if anyone had my private key...
>>
>>Paul
>=20
>=20
> well I do not see .ssh/authorized_keys
If it's not there, it will be created by the '>>' redirection.
The sshd doesn't care whether the file exists and is empty or doesn't=20
exist. In both cases, no public keys from the client user exist and a=20
password will be requested.
--=20
These are my personal views and not those of Fujitsu Siemens Computers!
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: http://www.fujitsu-siemens.com/imprint.html
Re: SCP putting file problem
am 18.10.2007 01:54:45 von unknown
Post removed (X-No-Archive: yes)
Re: SCP putting file problem
am 18.10.2007 04:31:10 von Joe Smith
lerameur wrote:
> well I do not see .ssh/authorized_keys
So? Just create one.
remote% cat >>.ssh/authorized_keys
^D
remote% ls -l .ssh
> but I do see /dir/.ssh/known_hosts
Irrelevant; that file is not used for incoming connections.
-Joe
Re: SCP putting file problem
am 18.10.2007 06:56:17 von Charles DeRykus
On Oct 17, 7:31 pm, Joe Smith wrote:
> lerameur wrote:
> > well I do not see .ssh/authorized_keys
>
> So? Just create one.
>
> remote% cat >>.ssh/authorized_keys
>
> ^D
> remote% ls -l .ssh
>
> > but I do see /dir/.ssh/known_hosts
>
> Irrelevant; that file is not used for incoming connections.
That's true and I haven't used Net::SCP but, the scp could
potentially fail because the local ssh config forces a manual
acceptance check of the
remote host IP if there hasn't been an earlier
SSH connection. Once the connection is accepted,
the remote IP and its public key is added to
'known_hosts'.
--
Charles DeRykus