|
SSH/SCP Question
Thanks to this forum, I was able to get a program running that uses SSH to control programs running on other hosts. Now I'd like to enhance it.
The control program on the target hosts occassionally needs to be updated. Updating the menu program on the source host is easy as it is on one host. The control program runs on several dozen.
Since I have the SSH connection and a config file containing a list of target hosts and login Ids, I figured I could modify my menu program to automate the sending of the updated control program out to the target servers.
Tried two ways:
1. First, I tried to perform an SCP in the menu program to one of the target hosts. When I do that the SSH takes over. Since my control program is listed in the key in the authorized_keys files on the target hosts, it tries to run my control program. It fails, since it checks for a valid command and other parameters that are sent over in the SSH_ORIGINAL_COMMAND. A similiar condition occurs when I attempt to SCP from the command line.
2. Then I tried to create a new command in my menu program, UPD, that it would send to the control program on the target hosts. Once there, the target host would run new code that would do an SCP of the new code from the source host to the target host. When I did that it exited on the SCP saying "Connection refused".
For my first attempt, does setting up a command in the SSH key, disable the use of SCP from the source to target host?
For my second attempt, is the failure the result of no SSH key? I have keys set up to allow SSH access from the source to the targets. On the target, if I perform an SCP to copy code from the source to the target, do I need to set up keys again?
|