Category Archives: Inf. Tech

Mount Windows Folder Sharing on RHEL 6/CentOS 6

Scenario:
-Mount Windows Folder Sharing (CIFS) on RHEL 6/CentOS 6.
-Set only Linux user cifs that have RWX access.
-Hide sharing credentials from other Linux users.
-Mount permanent at boot.

System: CentOS 6

Steps:
1) Edit /etc/fstab
# vi /etc/fstab
Continue reading

Setup Ethernet Bonding on RHEL 6

Scenario: Configure 4 ethernet into 2 ethernet bond0 and bond1 on RHEL 6/CentOS 6.
System: RHEL 6.9

Steps:
1) Create new file bond0 (Eth0+Eth1) with IP Address = 172.16.10.70
# vi /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0
IPADDR=172.16.10.70
NETMASK=255.255.255.0
TYPE=Bond
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
USERCTL=no
PEERDNS=yes
IPV6INIT=no

Continue reading

Command to re-read new VM disk CentOS 6/RHEL 6

System: CentOS 6.9

Case:
Added new VM disk in CentOS 6 not showing the new VM disk when run fdisk -l.

Resolution:
Login as root, run this command to re-read the new VM disk without reboot the server.

ls /sys/class/scsi_host/ | while read host ; do echo "- - -" > /sys/class/scsi_host/$host/scan ; done

Continue reading

Setup Banner on Console and Remote login CentOS/RHEL 6

Example add below banner.


********************************************************************
*                                                                  *
* This system is for the use of authorized users only.  Usage of   *
* this system may be monitored and recorded by system personnel.   *
*                                                                  *
* Unauthorized access to this machine is prohibited                *
* Press Ctrl+D if you are not an authorized user                   *
*                                                                  *
* Anyone using this system expressly consents to such monitoring   *
* and is advised that if such monitoring reveals possible          *
* evidence of criminal activity, system personnel may provide the  *
* evidence from such monitoring to law enforcement officials.      *
*                                                                  *
********************************************************************

Continue reading

Command to re-read added new VM disk that not showing real size CentOS 6

System: CentOS 6.9

Case:
– User request in ESXi to add new 30 GB VM disk(2nd disk it mean sdb) but accidentally wrong added VM disk only 10 GB,after remove the 10 Gb and added 30 GB when run fdisk -l still showing 10 GB VM disk size.

Resolution:
Login as root, run this command to re-read the new disk size without reboot the server.

# echo 1 > /sys/block/sdb/device/rescan

Continue reading

Increase or Decrease LV Swap in CentOS 6/RHEL 6

Scenario: How to increase or decrease swap space(logical volume swap) in CentOS 6/RHEL 6

System: CentOS 6/ RHEL 6

Steps increase Swap space
Example increase 1 GB swap space.

1) You must check the path of swap logical volume and the free space in the swap volume group before continue to step 2.
# free -m
# lvdisplay | grep swap
# vgs

Continue reading

Fixing Postfix error unknown user name value: nobody

System: RHEL 6.9

Just got complain from App support Postfix was error.
Check on /var/log/maillog show this error
postfix[2319]: fatal: file /etc/postfix/main.cf: parameter default_privs: unknown user name value: nobody

The solution I did,check on /etc/passwd and found the user nobody in comment state.
Uncomment nobody and Postfix can start again.

# vi /etc/passwd
Uncomment nobody

# service postfix restart

Install VMware-tools on CentOS 6

Scenario: Install VMware-tools CentOS 6 on VMware ESXi 6

Steps:
– Right click on guest VM.
– Select Install/Upgrade VMware Tools. Note: VMware tools installer will assign as CD/DVD or iso image in the server.
– Login as root access the server or SSH remote to install VMware tools.
Continue reading