System.out.printf(">> running [%s] on group %s as %s%n", command, groupName, login.identity);
// when you run commands, you can pass options to decide whether to
// run it as root, supply or own credentials vs from cache, and wrap
// in an init script vs directly invoke
Map<? extends NodeMetadata, ExecResponse> responses = compute.runScriptOnNodesMatching(//
inGroup(groupName), // predicate used to select nodes
exec(command), // what you actually intend to run
overrideLoginCredentials(login) // use my local user &
// ssh key
.runAsRoot(false) // don't attempt to run as root (sudo)