| CPUG | |
| The Check Point User Group | |
| A Resource For The Check Point Community. Fast. Useful. Independent. | |
|
| |||||||
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| I have a problem that I've been trying to figure out for a while now. I'm hoping someone starter than I can help me out. Situation: I have my Enforcement Points (EPs) automatically creating a backup file each night. I've wrote a script that is on my Management Server. It performs a SCP command that goes to the EPs and pulls the file to the Management Server. I've created the whole publickey thing so that the script doesn't have to have passwords in the script. My Problem: When I setup my Crontab to run the script, it doesn't use the publickey. My Puzzlement: When I manually run my script, it works like a charm. The Logs: Log file off of Management Server (Failure): Cronjob [LOG_INFO] sshd-x[4931]: Failed password for admin from 192.168.191.66 port 33652 ssh2 Log file off of Management Server (Success): Manual [LOG_INFO] sshd-x[5499]: Accepted publickey for admin from 192.168.191.66 port 33900 ssh2 On Management Server: crontab -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.14824 installed on Fri Aug 17 13:40:50 2007) # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $) 0 22 * * 5 backup_util sched 30 3 * * * /home/tomahawk77/config_backup.sh The Script: Line in Script (on Management Server) /usr/bin/scp -i $HOME/.ssh/id_dsa admin@192.168.191.94:/var/backup/sched/FW.tgz /var/Net_Eng/scripts/Firewall/. Any suggestions? A couple things to note…
Thanks, Tomahawk77 |
| |||
| try the solution in this thread, and throw away your scp script. Backup to SCP server one thing to clarify. the username is admin but the ID is '0' so the keys have to store in the /root/.ssh directory. => $HOME points to /root for other scripts include the /etc/bashrc file to setup the environ |
| |||
| put this line into your script and it will work: sh /opt/CPshrd-R55/tmp/.CPprofile.sh or csh sh /opt/CPshrd-R55/tmp/.CPprofile.csh The reason it fails in cron is because it does not have checkpoint environment variable. |
| |||
| Thanks dsb.nepo When I use the .ssh key information from the root directory, it works. That problem has plagued me from months. Tomahawk77 Quote:
|
![]() |
| Thread Tools | |
| Display Modes | |
| |