Created
March 7, 2017 21:49
-
-
Save jchodakowski/f7052d7f6887177b8c72812f937adc74 to your computer and use it in GitHub Desktop.
Nessus user provisioning script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
useradd -m -s /bin/bash -G sudo nessus | |
mkdir -pm 700 /home/nessus/.ssh | |
if [ -f /tmp/nessus_id_rsa.pub ]; then | |
cat /tmp/nessus_id_rsa.pub > /home/nessus/.ssh/authorized_keys | |
chown -R nessus. /home/nessus/.ssh | |
chmod 700 /home/nessus/.ssh | |
chmod 600 /home/nessus/.ssh/authorized_keys | |
fi | |
printf "nessus\tALL=(ALL)\tNOPASSWD: ALL\n" > /etc/sudoers.d/nessus | |
visudo -cf /etc/sudoers.d/nessus |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment