Posts

Installing https and using OpenSSL to apache

First nee to install the openssl and mod ssl and then generating the certificate to be used. To install OpenSSL and mod ssl Open a terminal prompt and issue the following command   [root@bacula conf.d]# yum install mod_ssl Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile  * base: mirror.nbrc.ac.in  * epel: kartolo.sby.datautama.net.id  * extras: mirror.nbrc.ac.in Resolving Dependencies --> Running transaction check ---> Package mod_ssl.x86_64 1:2.4.6-67.el7.centos.5 will be installed --> Finished Dependency Resolution Dependencies Resolved ==================================================================================  Package                     Arch                       Version                                  ...

How to Install iostat Using yum

  iostat command is used to check disk input/output statistics in real time [root@Clients7]#   yum install iostat Loaded plugins: fastestmirror Determining fastest mirrors epel/x86_64/metalink                                                                      | 8.6 kB   00:00:00   * base: centos.excellmedia.net   * epel: ftp.jaist.ac.jp   * extras: centos.excellmedia.net   * updates: centos.excellmedia.net base                               ...

How to install wireshark in Ubuntu 18.04

Dowanlod the latest reposotory from : https://launchpad.net/~wireshark-dev/+archive/ubuntu/stable Open terminal and type the commands: sudo apt-get install wireshark sudo dpkg-reconfigure wireshark-common sudo adduser $USER wireshark wireshark if you getting wireshark running error, so close it and then just do the following Go to usr/share/wireshark Open init.lua with a text editor Change disable_lua = false to disable_lua = true https://osqa-ask.wireshark.org/questions/16343/install-wireshark-on-ubuntu

CentOS 7 PHP version7.2 official repository

CentOS 7 PHP version7.2 official repository Command to install the EPEL repository configuration package: yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm Command to install the Remi repository configuration package: yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm Command to install the yum-utils package (for the yum-config-manager command): yum install yum-utils If you want a single version which means replacing base packages from the distribution Packages have the same name than the base repository, ie php-* Some common dependencies are available in remi-safe repository, which is enabled by default PHP version 7.2 packages are available for CentOS 7 in remi-php72 repository If the priorities plugin is enabled, ensure remi-php72 have higher priority (a lower value) than base and updates Command to enable the repository: yum-config-manager --enable remi-php72 Command to upgrade (the reposito...

bash script to install java on Linux

Install JDK 7 or JDK 8 by Shell Script on Linux Create a file on root directory with name of jdk-install.sh and give execute permission. # touch /root/jdk-install.sh # chmod +x jdk-install.sh #sh jdk-install.sh  jdk-archive-file.tar.gz ###################### #!/bin/bash ORACLE_DOWNLOAD_LINK=http://www.oracle.com/technetwork/java/javase/downloads/index.html ########## if [ "$#" = 0 ] then echo "Usage:$0 [options] jdk-archive-file.tar.gz" exit 1 fi JDK_ARCHIVE=$1 #Check if the script is running with root permissions if [ `id -u` -ne 0 ]; then    echo "The script must be run as root! (you can use sudo)"    exit 1 fi #   Is the file a valid archive? echo -n "Validating the archive file... " gunzip -t $JDK_ARCHIVE 2>> /dev/null if [ $? -ne 0  ]; then    echo "FAILED"    echo    echo "Provided file is not a valid .tar.gz archive: $JDK_ARCHIVE"    echo    echo "Be su...

Install SSL Certificate on Webmin

Download and Extract SSL certificates After getting an SSL certificate in a zip file via your email, download and extract certificate files (primary and intermediate certificate) to a local directory. Replace old minserv.pem file: Locate miniserv.Pem file (usually in /etc/webmin/). Now it is time to replace mineserv.Pem file with a combination of a private key and primary certificate. Basically, you can create a new miniserv.Pem file in two ways. Run the command : cat private.key yourcommonname.crt > new_miniserv.pem Note: the private.key used in the above command is the file of your private key and

How To Reset Your Forgotten Root Password On CentOS/Ubuntu Servers

Image
CentOS 6 Click [View Console] to access the console and click the send CTRL+ALT+DEL button on the top right. Alternatively, you can also click [RESTART] to restart the server. You will see a GRUB boot prompt telling you to press any key - you have only a few seconds to press a key to stop the automated booting process. (If you miss this prompt you will need to restart the VM again) At the GRUB prompt, type "a" to append to the boot command. Add the text "single" and press enter. System will boot and you will see the root prompt. Type "passwd" to change the root-password and then reboot again. CentOS 7 Click [View Console] to access the console and click the send CTRL+ALT+DEL button on the top right. Alternatively, you can also click [RESTART] to restart the server. As soon as the boot process starts, press ESC to bring up the GRUB boot prompt. You may need to turn the system off from the control panel and then back on to reach the GRUB bo...

Install AIDE package on CentOS/RHEL

1. Install AIDE package on CentOS/RHEL: # yum install -y aide 2. Check and adjust aide configuration file to fulfill your needs: # vim /etc/aide.conf 3. Initialize AIDE database - it will scan all the files in folders that were included in the config file and save their hash as well as attributes info 4. You may consider keeping golden copy of AIDE database (default is set to /var/lib/aide/aide.db.gz) is secure and read-only location. It will allow you to compare current system integrity to the golden copy. To check what changed run: # aide -C If you get "Couldn't open file /var/lib/aide/aide.db.gz for reading" error it means you need to move database generated in step 3 to this location: #  mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz

fatal: parameter inet_interfaces: no local interface found for ::1

Error:  fatal: parameter inet_interfaces: no local interface found for ::1 [root@Centos7 postfix]# systemctl restart postfix Job for postfix.service failed because the control process exited with error code. See "systemctl status postfix.service" and "journalctl -xe" for details. [root@Centos7 postfix]# systemctl status postfix.service ● postfix.service - Postfix Mail Transport Agent    Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled)    Active: failed (Result: exit-code) since Tue 2018-01-02 16:50:43 IST; 4s ago   Process: 12908 ExecStart=/usr/sbin/postfix start (code=exited, status=1/FAILURE)   Process: 12905 ExecStartPre=/usr/libexec/postfix/chroot-update (code=exited, status=0/SUCCESS)   Process: 12901 ExecStartPre=/usr/libexec/postfix/aliasesdb (code=exited, status=75) Jan 02 16:50:41 Centos7.windows.local systemd[1]: Starting Postfix Mail Transport Agent... Jan 02 16:50:41 Centos7.windo...

how to secure tmp partation in linux

1. Create separte partation for tmp , if you don't have the space to create a fresh /tmp partition on existing drives, you can use the loopback capabilities of the Linux kernel by creating a loopback filesystem that will be mounted as /tmp and can use the same restrictive mount options. To create a 1GB loopback filesystem, execute the following commands. [root@Centos7 ~]# dd if=/dev/zero of=/dev/tmpDIR bs=1024 count=1000000 1000000+0 records in 1000000+0 records out 1024000000 bytes (1.0 GB) copied, 5.32903 seconds, 192 MB/s 2. Backup Current /tmp Directory: Now backup the current /tmp directory using the syntax below which will keep the same permissions for the files currently in /tmp. [root@Centos7 ~]# cp -Rpf /tmp /tmpbak 3.Modify fstab: You should add a line to the end of the /etc/fstab file so the tmp partation so tmp is mounted when the server reboots. /dev/mapper/centos-tmp  /tmp                    xfs  ...

NTPd : NTP Server installation on centos7

1. NTP package is provided by default from Centos  repositories, and can be installed by the following command: [root@Centos7 ~]# yum -y install ntp 2. Configure these lines. [root@Centos7 ~]# vi /etc/ntp.conf # line 18: add the network range you allow to receive requests restrict 172.160.0.0 mask 255.255.0.0 nomodify notrap # change servers for synchronization #server 0.centos.pool.ntp.org iburst #server 1.centos.pool.ntp.org iburst #server 2.centos.pool.ntp.org iburst #server 3.centos.pool.ntp.org iburst server ntp1.example.local iburst server ntp2.example.local iburst 3. Once the installation completes, start the service and configure it so it starts automatically each time the server boots: [root@Centos7 ~]# systemctl start ntpd [root@Centos7 ~]# systemctl enable ntpd 4. Add the NTP service in firewall [root@Centos7 ~]# firewall-cmd --add-service=ntp --permanent success [root@Centos7 ~]# firewall-cmd --reload success 5. To get a basic report you c...

MySql - Convert InnoDB to MyISAM Storage Engine of Database

MySql - Convert InnoDB to MyISAM Storage Engine of Database To convert Database InnoDB Tables to MyISAM steps follow these steps 1. Take the backup of Mysql database [root@Centos7 ]# mysqldump -f --opt mysqldb > /usr/mysqldb.sql 2. Convert the ENGINE from InnoDB to MYISAM  by using below commans. [root@Centos7 ]#mysql -u username -p -e "SELECT concat('ALTER TABLE ', TABLE_NAME,' ENGINE=MYISAM;') FROM Information_schema.TABLES WHERE TABLE_SCHEMA = 'db_name' AND ENGINE = 'InnoDB' AND TABLE_TYPE = 'BASE TABLE'" | tail -n+2 >> /root/MYISAM.sql Note : Update  username and db_name values with your own values. 3. mport that MYISAM.sql file into INNODB database [root@Centos7 ]# mysql -u username -p mysqldb < /root/MYISAM.sql 4. Make it permanent, add to my.cnf default-storage-engine= MyISAM

How to scan new iSCSI disks in Linux ?

How to scan new iSCSI disks in Linux ? 1.First check which are the existing disk available on linux server from fdisk. [root@Centos7 ~]# fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-|type|identifier' Disk /dev/xvda: 53.7 GB, 53687091200 bytes, 104857600 sectors Disk /dev/mapper/cl-root: 10.7 GB, 10737418240 bytes, 20971520 sectors Disk /dev/mapper/cl-swap: 5368 MB, 5368709120 bytes, 10485760 sectors Disk /dev/mapper/cl-usr: 10.7 GB, 10737418240 bytes, 20971520 sectors Disk /dev/mapper/cl-home: 2147 MB, 2147483648 bytes, 4194304 sectors Disk /dev/mapper/cl-var: 5444 MB, 5444206592 bytes, 10633216 sectors Disk /dev/mapper/cl-tmp: 2147 MB, 2147483648 bytes, 4194304 sectors 2.Find out how many SCSI controller configured. [root@Centos7 ~]# ls -l /sys/class/scsi_host/ total 0 lrwxrwxrwx 1 root root 0 Dec 11 12:09 host0 -> ../../devices/pci0000:00/0000:00:01.1/ata1/host0/scsi_host/host0 lrwxrwxrwx 1 root root 0 Dec 11 12:09 host1 -> ../../dev...

How to install and Configuring manual or automatic node login with iSCSI Initiator

Configuring manual or automatic node login with iSCSI 1. Install the software package: [root@Centos7 ~]# yum -y install iscsi-initiator-utils 2. Configure the iqn name for the initiator: [root@Centos7 ~]# cat /etc/iscsi/initiatorname.iscsi InitiatorName=iqn.2017-12.com.centos7:Centos7 3. Edit the iSCSI initiator configuration: # vi /etc/iscsi/iscsid.conf # To manually startup the session set to "manual". The default is automatic. node.startup = automatic # To enable CHAP authentication node.session.auth.authmethod = CHAP # To set a CHAP username and password for initiator node.session.auth.username = iscsiadmin node.session.auth.password = P@$$w0rd 4. Start iSCSI initiator daemon: [root@Centos7 ~]# systemctl start iscsi [root@Centos7 ~]# systemctl enable iscsi 5.Discovering targets in our iSCSI server: [root@Centos7 ~]# iscsiadm --mode discovery -t sendtargets --portal 172.16.20.90 172.16.20.90:3260,1 iqn.2004-04.com.sanstorage:tvs-671:iscsi.sa...

Enable https on Apache website

How to install OpenSSL and mod ssl First need to install the openssl and mod ssl and then will generating the certificate to be used. Open a terminal prompt and issue the following command  [root@Centos7 conf.d]# yum install mod_ssl Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile  * base: mirror.nbrc.ac.in  * epel: kartolo.sby.datautama.net.id  * extras: mirror.nbrc.ac.in Resolving Dependencies --> Running transaction check ---> Package mod_ssl.x86_64 1:2.4.6-67.el7.centos.5 will be installed --> Finished Dependency Resolution Dependencies Resolved ========================================================================  Package                     Arch                 ...

How install xrdp on CentOS 7 / RHEL 7

How to install xrdp on CentOS 7 / RHEL 7 1. First Install Gnome on CentOS 7 2. Install and configure EPEL repository. [root@Centos7 system]# yum install epel-release Loaded plugins: fastestmirror, langpacks base                                                                                                           | 3.6 kB  00:00:00 extras                                                                                                         | 3...