[StarCluster] suppressing interactive confirmation for ssh

Steve Jaffe sjaffe at riskspan.com
Tue Dec 11 16:44:29 EST 2012


Thanks for the suggestion but I'm not sure why another level of indirection would matter.

Anyway, I did a bit of ssh research came up with a workable solution: altering the ~/.ssh/config file to suppress the confirmation only for addresses in the amazonaws.com domain.

I've tested this and it works, so I think that's taken care of for now.

Regarding the API in general: I just read the user guide section on developing plugins, from which it is clear that these are just python scripts that indeed use the starcluster python API. So it's not that the API is meant to be hidden by design. Apparently there's just no documentation, so you just have to dig through the files yourself, presumably starting with the commandline script. I might do this at some point but for the little bit I'm doing it's simpler for now just to use system calls.

Regards,
Steve

-----Original Message-----
From: David Erickson [mailto:derickso at stanford.edu] 
Sent: Tuesday, December 11, 2012 4:11 PM
To: Steve Jaffe
Cc: starcluster at mit.edu
Subject: Re: [StarCluster] suppressing interactive confirmation for ssh

Hi Steve-
Just for sake of completeness, have you tried embedding your command in 
a bash script then executing the bash script?  I've had the same issues 
in the past, and I seem to recall that it fixes itself if executed from 
a non-interactive shell.  Justin and I went back and forth on this same 
point earlier in the year if you check the archives.

-D

On 12/11/2012 12:03 PM, Steve Jaffe wrote:
> Thanks, but that's already what I'm doing and it doesn't work.
>
> I just checked again and confirmed that ssh requests confirmation even when given a command to execute, eg:
>
> $ starcluster sshmaster mycluster "ls"
>
> The authenticity of host 'ec2-54-242-24-158.compute-1.amazonaws.com (54.242.24.158)' can't be established.
> RSA key fingerprint is c6:90:9c:45:27:76:eb:f1:58:21:7e:b9:6b:f1:c7:8c.
> Are you sure you want to continue connecting (yes/no)?
>
> I don't know if there's a way to change my ssh configuration to avoid this (while not also creating a general security hole.) I can't add the host in advance since it's not known until I start the cluster. Here again I suspect the python API would make this simpler since it would undoubtedly give me access to the host IP address and RSA fingerprint which I could add to my known_hosts file.
>
> I could do this by capturing the commandline output from "starcluster start" and parsing it for the information (or similarly using "listcluster"), and in the absence of any better solution that's probably what I'll do.
>
> But I do suspect that I'm not the first to want to script starcluster, so if anyone has any information/examples of using the python API directly that would be great.
>
> Thanks for your help.
>
> Steve
>
> -----Original Message-----
> From: David Erickson [mailto:derickso at stanford.edu]
> Sent: Tuesday, December 11, 2012 2:07 PM
> To: Steve Jaffe
> Cc: starcluster at mit.edu
> Subject: Re: [StarCluster] suppressing interactive confirmation for ssh
>
> Steve-
> You shouldn't get the confirmation if you provide sshmaster/node with an
> actual command to run in non-interactive mode, give it a go.
>
> On 12/11/2012 9:47 AM, Steve Jaffe wrote:
>> Hi,
>>
>> For scripting purposes I'd like to suppress the ssh confirmation after creating a new cluster and running sshnode (or sshmaster).
>>
>> Does anyone know how?
>>
>> Related question: is there any documentation on using the starcluster python api directly rather than via the 'starcluster' executable? It seems rather silly to write a python script that runs starcluster commands via system calls but I haven't found any way to get into the details of the API, other than trying to reverse-engineer the starcluster commands.
> I haven't seen any docs, but you could write plugins to do whatever you
> are looking for then trigger them with starcluster commands.
>
> -D
>
>




More information about the StarCluster mailing list