Posted By

beaknit on 07/25/11


Tagged

Bash aws


Versions (?)

User Add


 / Published in: Bash
 

  1. #! /bin/bash
  2.  
  3. useradd -m -s /bin/bash -G wheel <user>
  4. mkdir /home/<user>/.ssh
  5. echo "ssh-rsa <public key>" > /home/<user>/.ssh/authorized_keys
  6. chown -R <user>:<user> /home/<user>
  7. chmod 600 /home/<user>/.ssh/authorized_keys
  8.  
  9. echo "#include /etc/sudoers.local" >> /etc/sudoers
  10. echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.local
  11. chmod 440 /etc/sudoers.local

Report this snippet  

You need to login to post a comment.