Posts

Showing posts from February, 2025

Parameters: Command Execution Via Zabbix

AllowKey=system.run[*]---> Allows system.run[] to execute commands via item -----> High risk if unrestricted commands are allowed AllowRoot=1 -----> Allows Zabbix to execute commands as root EnableRemoteCommands=1---->Allows Zabbix server to run commands on agent----->High risk if unauthorized commands are sent

Public key/ private key

How to make the ssh connection on remote server from Ansible server Step1: Generate key ssh-keygen -t rsa -b 4096 Step2: Go to the path cd /root/.ssh ls authorized_keys id_rsa id_rsa.pub known_hosts Where id_rsa ----> private key (Used to login on the remote server without password)       id_rsa.pub ---->public key Note: If someone gets access to this file (id_rsa), they can log in to any server where the matching public key is stored! Step3: Copy the public key cat id_rsa.pub Step4: Paste the public key on remote server vi ~/.ssh/authorized_keys or vi /root/.ssh/authorized_keys Step5: Now we can login on remote server From Private key: ssh -i ~/.ssh/id_rsa user@remote-server From Public key:  Note: In case of ansible ansible-playbook playbook.yml --private-key ~/.ssh/id_rsa Note: In file /etc/ssh/sshd_config, below parameter should be enable: PubkeyAuthentication yes   PermitRootLogin yes   AuthorizedKeysFile .ssh/authorized_keys  Passwor...