10-01-2024 03:17 AM
Hi,
i have a known good working route to my sftp server, but seem unable to make it run as a kron operation. it just doesn't do anything!
It is configured as follows:
hostname# show run | section kron
kron occurrence nightly at 2:30 recurring
policy-list runconfbackup
kron policy-list runconfbackup
cli show run | redirect sftp://blah:blah@someip/etc/etc
I am wondering whether it may expect additional input for the sftp operation as when running sftp as a standalone command it asks to verify the destination and login... but don't know if that can be turned off...?
I am wondering whether it may be that on firing it requires additional input - shown below:
hostname# copy running-configsftp://blah:blah@someip/etc/etc
Address or name of remote host [someip]?
Destination username [etc]?
Destination filename [etc/xxconfg]?
a show kron schedule gives:
Kron Occurrence Schedule
nightly inactive, will run again in 0 days 16:18:06 at 2 :30 on
Solved! Go to Solution.
10-01-2024 04:44 AM
hello @wrunkle
Kron jobs are non-interactive, meaning they cannot handle user input prompts. If the SFTP command expects confirmation or input for the host, username, or filename, it will fail silently because Kron can't respond to these prompts.
If the SFTP server is prompting for host key verification, some SFTP servers or clients allow you to disable this. However, this is risky from a security standpoint, as it disables checking whether you're connecting to the correct server. Still, if this is acceptable in your environment, you can try disabling host key verification.
For example, if your Cisco device supports SSH/SFTP options that disable host verification, you'd want to look for an option like StrictHostKeyChecking no, but Cisco IOS might not have such fine-grained SFTP/SSH settings directly configurable. You'd need to consult the SFTP server for alternative configurations.
10-01-2024 04:44 AM
hello @wrunkle
Kron jobs are non-interactive, meaning they cannot handle user input prompts. If the SFTP command expects confirmation or input for the host, username, or filename, it will fail silently because Kron can't respond to these prompts.
If the SFTP server is prompting for host key verification, some SFTP servers or clients allow you to disable this. However, this is risky from a security standpoint, as it disables checking whether you're connecting to the correct server. Still, if this is acceptable in your environment, you can try disabling host key verification.
For example, if your Cisco device supports SSH/SFTP options that disable host verification, you'd want to look for an option like StrictHostKeyChecking no, but Cisco IOS might not have such fine-grained SFTP/SSH settings directly configurable. You'd need to consult the SFTP server for alternative configurations.
10-02-2024 09:04 AM
ok, that was kinda where i was going, thanks!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide