I have a situation where I'd like to run ssh from a script to connect to a different machine. In some cases, the machine's IP will have changed, due to DHCP. Is there a way I can either: 1. make ssh accept the new site without supplying the "yes" from the keyboard. or 2. Somehow set up a controlling terminal or virtual terminal to provide the "yes" that ssh requires? I have not been able to get something like "openvt" to work. I have no experience with these things. TIA, Bill
On Mon, Feb 25, 2002 at 01:10:52PM -0500, Bill Mills-Curran wrote:
I have a situation where I'd like to run ssh from a script to connect to a different machine. In some cases, the machine's IP will have changed, due to DHCP. Is there a way I can either:
1. make ssh accept the new site without supplying the "yes" from the keyboard.
Assuming you have passphraseless RSA/DSA keys setup, you can avoid the "are you sure you want to ..." question via the following commandline option: -o 'StrictHostKeyChecking=no' That tells SSH to not ask about adding hosts to the known_hosts file. I have a script which will take in a list of hosts via STDIN and SSH to each one running a certain command, so in the code I have the following that works nicely: $command = "ssh -f -n -q -c blowfish -x -o \'StrictHostKeyChecking=no\'"; $params = "$machine $remoteuser \'@ARGV\' 2>&1"; -- Randomly Generated Tagline: "if you don't know what Unix is, get off the internet." - Catherine Skidmore
Found it (RTFM)! Just add: -o "StrictHostKeyChecking no" to the command line. Bill On Mon, 25 Feb 2002, Bill Mills-Curran wrote:
Date: Mon, 25 Feb 2002 13:10:52 -0500 (EST) From: Bill Mills-Curran <subssn594@charter.net> To: Worcester Linux Users Group <wlug@mail.wlug.org> Subject: ssh/virtual terminal "challenge"
I have a situation where I'd like to run ssh from a script to connect to a different machine. In some cases, the machine's IP will have changed, due to DHCP. Is there a way I can either:
1. make ssh accept the new site without supplying the "yes" from the keyboard.
or
2. Somehow set up a controlling terminal or virtual terminal to provide the "yes" that ssh requires?
I have not been able to get something like "openvt" to work. I have no experience with these things.
TIA, Bill
participants (2)
-
Bill Mills-Curran
-
Theo Van Dinter