Problems with scp and cron
From: Robert Nickel (Robert_Nickel_at_bigfoot.com)
Date: 10/20/04
- Next message: Darren Dunham: "Re: Problems with scp and cron"
- Previous message: Andy: "OpenSSH failed non-root login"
- Next in thread: Darren Dunham: "Re: Problems with scp and cron"
- Reply: Darren Dunham: "Re: Problems with scp and cron"
- Reply: Richard E. Silverman: "Re: Problems with scp and cron"
- Reply: Robert Nickel: "Re: Problems with scp and cron"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 20 Oct 2004 13:52:11 +0200
Hi there,
I have successfully established a public-private-key connection from a
RedHat Linux machine to a remote server via ssh. The remote username is
rnickel, my local is robert. So, as user "robert" I can type
scp ~/tmp/* rnickel@remote:
and everything works fine without passphrase-prompt.
When running the same thing from a cron job (either from my own crontab
or from /etc/crontab as user robert) I get the error message
Permission denied (publickey).
(for my own crontab I have typed "crontab -u robert -e")
Can you tell me what the problem could be?
Thanks in advance
Robert Nickel
Here is my script and the corresponding output:
SCRIPT:
#!/bin/bash
#
# copy files to remote
#
echo I am $USER from $HOSTNAME
scp -i /home/robert/.ssh2/identification /tmp/* rnickel@remote:
rm /tmp/robert/*
OUTPUT (with verbose):
I am robert from baker.math.tu-cottbus.de
Executing: program /usr/bin/ssh host remote, user rnickel, command scp
-v -t .
OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090701f
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Rhosts Authentication disabled, originating port will not be
trusted.
debug1: Connecting to remote [141.43.65.25] port 22.
debug1: Connection established.
debug1: identity file /home/robert/.ssh2/identification type -1
debug1: Remote protocol version 2.0, remote software version 3.2.9.1 SSH
Secure Shell (non-commercial)
debug1: no match: 3.2.9.1 SSH Secure Shell (non-commercial)
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.6.1p2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Host 'remote' is known and matches the DSA host key.
debug1: Found key in /home/robert/.ssh/known_hosts:2
debug1: ssh_dss_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/robert/.ssh2/identification
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug1: Next authentication method: password
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).
debug1: Calling cleanup 0x8062d00(0x0)
lost connection
- Next message: Darren Dunham: "Re: Problems with scp and cron"
- Previous message: Andy: "OpenSSH failed non-root login"
- Next in thread: Darren Dunham: "Re: Problems with scp and cron"
- Reply: Darren Dunham: "Re: Problems with scp and cron"
- Reply: Richard E. Silverman: "Re: Problems with scp and cron"
- Reply: Robert Nickel: "Re: Problems with scp and cron"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|