def _ssh_copy_key(ssh_bin, master_address, ec2_key_pair_file, keyfile):
 with open(ec2_key_pair_file, 'rb') as f:
  args = [('bash -c "cat > %s" && chmod 600 %s' % (keyfile, keyfile))]
  _check_output(*_ssh_run(ssh_bin, master_address, ec2_key_pair_file, args, stdin=f.read()))

def _ssh_copy_key ( ssh_bin , master_address , ec2_key_pair_file , keyfile ) : with open ( ec2_key_pair_file , 'rb' ) as f : args = [ ( 'bash -c "cat > %s" && chmod 600 %s' % ( keyfile , keyfile ) ) ] _check_output ( * _ssh_run ( ssh_bin , master_address , ec2_key_pair_file , args , stdin = f . read ( ) ) )
prepare master to ssh to slaves by copying the emr private key to the master node .