Posts

snmp agent in Ubuntu

Step: 1 Install the snmp package. # apt-get install snmpd Step: 2 Before continue the configuration, take backup of the original snmp configuration file. # mv /etc/snmp/snmpd.conf  /etc/snmp/snmpd.conf.bkp Step: 3 Create a new configuration file # vim /etc/snmp/snmpd.conf rocommunity  abcdefgh syslocation  "Tech Support" syscontact  support@drbdtest.com Step: 4 Check and confirm that below mentioned configuration into your machine also.. # vim /etc/default/snmpd export MIBS= SNMPDRUN=yes SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf' Step: 5 Restart the snmp service. # /etc/init.d/snmpd restart #snmp

MySQL Data Replication in Ubuntu 18.04..4 LTS

For this configuration, we have setup below mentioned nodes: Master Node IP : 192.168.1.101 Slave Node IP         : 192.168.1.102 [ Step:01 ] Install MySQL on the Master server: #sudo apt-get update #sudo apt-get install mysql-server Install MySQL on the Slave server: #sudo apt-get update #sudo apt-get install mysql-server [ Step:02 ] ON MASTER NODE #vi sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf bind-address            = 192.168.1.101 server-id              = 1 log_bin                = /var/log/mysql/mysql-bin.log #sudo systemctl restart mysql #sudo mysql CREATE USER 'replica'@'192.168.1.102' IDENTIFIED BY '123456'; GRANT REPLICATION SLAVE ON *.* TO 'replica'@'192.168.1.102'; SHOW MASTER STATUS\G mysql> SHOW MASTER STATUS\G *************************** 1. row ***************************       ...

Raid Concepts

Image
Below attached video provides good concept for raid on linux. Ref: https://youtu.be/nxkXNZlJDJc

Create Local Repository in RHEL/CentOS

Step: 01 Extract/copy packages from RHEL DVD to local directory. #cp /run/media/sharif/<RHEL DVD name>/Packages/* /home/sharif/Desktop/PACK/ Step: 02 Create a repo file in yum.repos.d and add followings. #vim /etc/yum.repos.d/localrepo.repo [localrepo] name=Sharif Repository baseurl=file:///home/sharif/Desktop/PACK/ gpgcheck=0 enabled=1 Step: 03 Create repo database.  #createrepo -v /home/sharif/Desktop/PACK/ Step: 04 Do followings. #yum repolist all #yum clean all #yum update Now our repository is ready to use. Try installing something.

NFS Server in Ubuntu 16.04.4 LTS

For this setup, we have two machines as follows: Host : 192.168.1.150 Client : 192.168.1.200 Step 1 — Downloading and Installing the Components On Host Machine #sudo apt-get update #sudo apt-get install nfs-kernel-server On Client Machine #sudo apt-get update #sudo apt-get install nfs-common Step 2 — Creating the Share Directories on the Host Example 1: Exporting a General Purpose Mount On Host Machine #sudo mkdir /var/nfs/general -p #ls -la /var/nfs/general #sudo chown nobody:nogroup /var/nfs/general Example 2: Exporting the Home Directory Step 3 — Configuring the NFS Exports on the Host Server On Host Machine #sudo nano /etc/exports directory_to_share    client(share_option1,...,share_optionN) /var/nfs/general 192.168.1.200(rw,sync,no_subtree_check) /home        192.168.1.200(rw,sync,no_root_squash,no_subtree_check) #sudo systemctl restart nfs-kernel-server Step 4 — Creating the Mount Points on the Client ...

Restricting what users can send mail to off-site destinations

How can I configure Postfix in a way that some users can send mail to the internet and other users not. The users with no access should receive a generic bounce message. Please don't discuss whether such access restrictions are necessary, it was not my decision. Postfix has support for per-user restrictions. The restrictions are implemented by the SMTP server. Thus, users that violate the policy have their mail rejected by the SMTP server. Like this: 554 <user@remote>: Access denied The implementation uses two lookup tables. One table defines what users are restricted in where they can send mail, and the other table defines what destinations are local. It is left as an exercise for the reader to change this into a scheme where only some users have permission to send mail to off-site destinations, and where most users are restricted. The example assumes DB/DBM files, but this could also be done with LDAP or SQL. /etc/postfix/main.cf:     smtpd_recipient_restrict...

Protecting internal email distribution lists [Postfix]

We want to implement an internal email distribution list. Something like all@our.domain.com, which aliases to all employees. My first thought was to use the aliases map, but that would lead to "all" being accessible from the "outside", and this is not desired... :-) Option:01 Postfix can implement per-address access controls. What follows is based on the SMTP client IP address, and therefore is subject to IP spoofing. /etc/postfix/ main.cf : smtpd_recipient_restrictions = ... check_recipient_access hash :/etc/postfix/access ...the usual stuff... /etc/postfix/access: all@example.com permit_mynetworks ,reject # postmap /etc/postfix/access Remarks: This rule only permits my_networks user to send mail to  all@example.com email address. All outsiders will be rejected. Option:02 In the general case you need two lookup tables: one table that lists destinations that need to be protected, and one table that lists domains ...