ssh to openVMS ssh server via cron fails in Red Hat Enterprise Linux 5
Issue
- I tried to ssh to OpenVMS ssh server via cron, but it fails.
- The script runs via cron, however fail with exit status -1.
- But when it's executed manually via command line, it didn't fail with exit status 0.
- This is my script.
# cat test.sh
#!/bin/bash
ssh -v tester@remote.openvms.host <openvms command>
NOTE: openvms command was an actual openvms command.
- This is the scheduled cron.
# crontab -l
*/1 * * * * (. ~/.bashrc; /home/tester/test.sh) > /tmp/test.log 2>&1
- output from manually execution.
# ./test.sh
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.100.1 [192.168.100.1] port 22.
debug1: Connection established.
debug1: identity file /home/tester/.ssh/identity type -1
debug1: identity file /home/tester/.ssh/id_rsa type 1
debug1: identity file /home/tester/.ssh/id_dsa type 2
debug1: loaded 3 keys
debug1: Remote protocol version 2.0, remote software version 3.2.0 SSH OpenVMS V5.5 VMS_sftp_version 3
debug1: no match: 3.2.0 SSH OpenVMS V5.5 VMS_sftp_version 3
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3
...
debug1: channel 0: free: client-session, nchannels 1
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.7 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 0
- Cron job output
# cat /tmp/test.log
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.100.1 [192.168.100.1] port 22.
debug1: Connection established.
debug1: identity file /home/tester/.ssh/identity type -1
debug1: identity file /home/tester/.ssh/id_rsa type 1
debug1: identity file /home/tester/.ssh/id_dsa type 2
debug1: loaded 3 keys
debug1: Remote protocol version 2.0, remote software version 3.2.0 SSH OpenVMS V5.5 VMS_sftp_version 3
debug1: no match: 3.2.0 SSH OpenVMS V5.5 VMS_sftp_version 3
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3
...
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.2 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status -1
Environment
Red Hat Enterprise Linux 5.8
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.