Dermot пишет:
Hi,
I installed Net::SCP as I was reminded of the module in a recent post.
I need to copy files from one server to another. I generated ssh-keys
for a user and I can use
scp test.txt myserver:/home/somedude/mytest.txt
without passwords when I su to that user but when I run the script as
myself it doesn't work.
# $DEBUG = 1;
scp /home/somedude/fo.txt [EMAIL PROTECTED]:/home/images/my170px.jpg
256 lost connection
You should generate ssh keys for the user which runs your script.
[EMAIL PROTECTED] ssh-keygen -t rsa
then add your key from /home/dermot/.ssh/id_rsa.pub (I don't remember
exact file names)
to the end of /home/remote_user/.ssh/authorized_keys
1) $ ssh-keygen -t rsa
2) $ ssh-copy-id -i ~/.ssh/id_rsa [EMAIL PROTECTED]
3) $ scp ~/.ssh/id_rsa.pub [EMAIL PROTECTED]
4) $ ssh [EMAIL PROTECTED]
5) remote$ mkdir -p ~/.ssh; chmod 711 ~/.ssh
remote$ cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
6) remote$ chmod 600 ~/.ssh/authorized_keys
7) remote$ rm ~/id_rsa.pub
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/