Skip to content

Instantly share code, notes, and snippets.

View alanreynosov's full-sized avatar

Alan alanreynosov

View GitHub Profile
@alanreynosov
alanreynosov / disable-password.yml
Last active August 21, 2020 23:50
ansible playbook to disable password authentication in a raspberry pi with raspberry OS or any debian based distro
- name: Log in as pi user to disable root
hosts: nodes
user: "pi"
gather_facts: false
become: yes
tasks:
- name: Disable root login over SSH
lineinfile: dest=/etc/ssh/sshd_config regexp="^PermitRootLogin" line="PermitRootLogin no" state=present
notify:
sudo tail -fn0 /var/log/httpd/error_log | \
while read line ; do
echo "$line" | grep "[error]"
if [ $? = 0 ]
then
echo "Error from Apptest Regalli : $line" | mail -s "Error message email" help@regalii.com
fi
done