Secure deletion and recovery files under CentOS Shell script

  Owing to the use of most of the Linux file system is Ext3 format, files once deleted, probably can’t be recovered, even if the recovery is also very cumbersome. So the RM command to become extremely dangerous, so we can write Shell scripts to implement the ability to safely remove and restore files. The […]

CentOS 61-key system Shell script

  CentOS version 6.2 has been released and can now be used in a production environment, the new version of the kernel should make better use of hardware. Wrote a script that is used to initialize the system environment, now share it, you can according to their own needs, modify the script accordingly. Script as […]

CentOS 6.5 initialize optimization script

#!/bin/bash echo “This is a system initialization script, carefully run!” input_fun() {     OUTPUT_VAR=$1     INPUT_VAR=””     while [ -z $INPUT_VAR ];do         read -p “$OUTPUT_VAR” INPUT_VAR     done     echo $INPUT_VAR } input_again() { MYHOSTNAME=$(input_fun “please input the hostname:”) DOMAINNAME=$(input_fun “please input the domainname:”) CARD_TYPE=$(input_fun “please input card type(eth0):”) IPADDR=$(input_fun “please input ip address(192.168.100.1):”) NETMASK=$(input_fun “please input netmask(255.255.255.0):”) GATEWAY=$(input_fun “please input gateway(192.168.100.1):”) MYDNS1=$(input_fun “please input DNS1(114.114.114.114):”) MYDNS2=$(input_fun “please input DNS2(8.8.4.4):”) } input_again MAC=$(ifconfig $CARD_TYPE | grep “HWaddr” | awk -F[” “]+ ‘{print $5}’) #SET COMPUTER NAME cat >/etc/sysconfig/network <<ENDF NETWORK=yes HOSTNAME=$MYHOSTNAME ENDF cat >/etc/sysconfig/network-scripts/ifcfg-$CARD_TYPE <<ENDF DEVICE=$CARD_TYPE BOOTPROTO=static HWADDR=$MAC NM_CONTROLLED=yes ONBOOT=yes TYPE=Ethernet IPV6INIT=no IPADDR=$IPADDR NETMASK=$NETMASK GATEWAY=$GATEWAY ENDF /etc/init.d/network restart cat >/etc/hosts <<ENDF 127.0.0.1 $MYHOSTNAME $MYHOSTNAME.$DOMAINNAME localhost $IPADDR $MYHOSTNAME $MYHOSTNAME.$DOMAINNAME  localhost ENDF cat >/etc/resolv.conf <<ENDF […]

Setup PPTP VPN CentOS 6.x key script

The environment CentOS 6.x 32 bit/64 bit XEN/KVM/OpenVZ Steps Then run the following command #wget http://www.hi-vps.com/shell/vpn_centos6.sh #chmod a+x vpn_centos6.sh Install Centos6.2PPTPVPN script #bash vpn_centos6.sh Executed after 1, 2, 3 in English, the following meaning in Chinese. 1. install the VPN service 2. fixed VPN 3. Add a VPN user We want to install the PPTP […]

How to CentOS optimization

1, at startup virtual cores, and now need to start the common core, to read as follows: vim /etc/grub.conf           default=1  #Change the default 0 1 timeout=5 splashimage=(hd0,0)/boot/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.18-194.el5xen) root (hd0,0) kernel /boot/xen.gz-2.6.18-194.el5 module /boot/vmlinuz-2.6.18-194.el5xen ro root=LABEL=/ rhgb quiet module /boot/initrd-2.6.18-194.el5xen.img title CentOS-base (2.6.18-194.el5) root (hd0,0) kernel /boot/vmlinuz-2.6.18-194.el5 ro […]

CentOS system IP access control

entOS system IP access control   If scenario: there are a bunch of machines, which accessed the server IP address is: 192.168.1.1, allow access to the IP address: 192.168.1.2 and the rest would not have to write, anyway, don’t have to.   Basic Linux system is to use SSH connections, could be achieved by way […]

CentOS tips (simple security settings)

1, locked not applicable account number Backup method: #cp -p /etc/passwd /etc/passwd_bak #cp -p /etc/shadow /etc/shadow_bak Reinforcement method: Use the command < username > lock unnecessary accounts. Use the command < username > unlocks the account needs to be restored. Locked users cannot log on, using Su–username, you can still toggle normal 2, the password […]

Centos enhanced Apache Server security and protection

  Apache server where it goes, UNIX/Linux like there, this shows in the area of Apache WEB server performance and market share Today‘s Internet environment, Web services have become essential business of the enterprises, followed by most security issues, attacks shifted their emphasis to Web attacks, many valuable customers and Web services in conjunction with […]

CentOS Server security configuration policies

  Servers often have recently been invaded and roughly analyzed the intrusion, and a security policy that needs to be done: Managing machine settings: 1. stepping stones only open operations staff A … operation and maintenance personnel passwords must be reset, password length is not less than 8-bit B. password must be uppercase and lowercase, […]

After installing CentOS 7 will do the seven things

  The Linux version of CentOS is most commonly used to run the server, CentOS is latest version 7. When you are interested in great on a single host or VPS installed on CentOS after 7, the first job must be to strengthen its security, the following seven things are you further configure the system […]