I want to have a user have sudo access without needing a password, so I did this.
sudo vi /etc/sudoers
Set this up:
# Members of the admin group may gain root privileges
%admin ALL=(ALL) NOPASSWD:ALL
sudo service sudo restart
sudo adduser sudo
# Members of the admin group may gain root privileges
%admin ALL=(ALL) NOPASSWD:ALL
sudo service sudo restart
sudo adduser sudo
ssh-keygenGenerating public/private rsa key pair.Enter file in which to save the key (/Users/client/.ssh/id_rsa): /Users/client/.ssh/new_keyEnter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /Users/client/.ssh/new_key.Your public key has been saved in /Users/client/.ssh/new_key.pub.
/Users/client/.ssh/new_key (private)/Users/client/.ssh/new_key.pub (public)
cat /home/john/new_key.pub >> /home/john/.ssh/authorized_keysNow the user can login using their private key.
ssh -i /Users/client/.ssh/new_key john@myserver.com