When you are administering a cluster you will need sudo permission, even with passwordless SSH you will find that some operations will require a password for usage and authentication, ie admin scripts on the nodes. there are two ways to get around this
- Redirection
- Create a file with your password in your home directory, make it rwx only for you ie chmod ou-rwx <password file>
- in your admin script redirec the passwor call in the ssh command call
- ssh felcl${num} sudo shutdown -h now < ~/psswd &
- this will redirect and enter the pasword to all of the nodes that you are trying to access as sudoer.
- Sudoers file
- The cleaner method is to create a sudoers file and allow the admins passworless sudo access
- You may think oh that easy, but the problem is that OS X sudoers file is not standard and dosent behave properly.
- after much experimentation and trial and error here is the proper /etc/sudoers file settings.
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults specification
# User privilege specification
%admin ALL= NOPASSWD: ALL
This will allow everyone in the admin group to perform cross node sudo commands withough having to enter passwords.