Skip to main content
Menu
devops | Cheatsheets
devops

Monitor and Alert SSH Login Activty

September 3, 2021
linux, mail
devops, monitoring

Edit sshrc file # vi /et/ssh/sshrc Add following lines ip=`echo $SSH_CONNECTION | cut -d " " -f 1` logger -t ssh-wrapper $USER login from $ip echo "User $USERjust logged in from $ip" | mail -s "[ATTENTION] $USERJust logged in from $ip" your-email@your-domain.com Monitor your ssh authorized_keys changes # create notify.sh script file and add following code of lines #!/bin/bash [[ -z `find /home/ubuntu/.ssh/authorized_keys -mmin -1` ]] if [ $? ...

Configure SMTP with Gmail Using Postfix

September 3, 2021
linux, mail
devops, monitoring

Setup Google App password # Go account security https://myaccount.google.com/security Create App Password Select App as Mail Select Device (other) > name your system Generate Note down Generated password Install all necessary packages # sudo apt-get install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules Edit postfix config file # vi /etc/postfix/main.cf and following lines to it: relayhost = [smtp.gmail.com]:587 smtp_tls_security_level = may smtp_sasl_auth_enable = yes smtp_sasl_security_options = smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_use_tls = yes mydestination = inet_protocols = ipv4 Edit sasl_passwd file # vi /etc/postfix/sasl_passwd add gmail username and generate password ...

Kubernetes Basic Concepts Note

June 25, 2021
devops, kubernetes
devops, concept

Architecture # Nodes # In Kubernetes nodes are the physical or virtual machines where workloads runs. Each nodes are managed by control plane and contains the services necessary to run Pods. Master Node # The master node’s role is the command and control for all the other worker nodes. There are many containers running on the master node, the primary of which is the kube-apiserver , which is responsible for validating the configure data for the API objects such as pods, services and others. ...