1, the creation of a 10G file system, the type of EXT4, requires the boot can be automatically mounted to a separate data/data directory;
(1) Creating 10G partitions
# Cat << EOF | FDISK/DEV/SDA > N > > +10g > W > EOF # partx-a/DEV/SDA # partx-a/DEV/SDA
(2) formatting
# mke2fs-t Ext4/dev/sda5
(3) Create a directory and edit the/etc/fstab file
# mkdir/data/dev/ada5/data EXT4 Defaults 0 0
2, display the ' Netstat-tan ' command results with ' LISTEN ' followed by 0, one or more blank characters end of the line;
# Netstat-tan | grep "listean[[:space::]]*"
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/78/7D/wKioL1Z-Lgrx1V_MAAAOCLSFLAc898.png "title=" Image 1.png "alt=" Wkiol1z-lgrx1v_maaaoclsflac898.png "/>
3, add user Nginx, Zabbix, Tomcat, Nologin and Hadoop users (nologin user's shell is/sbin/nologin), and then find the/etc/passwd file in the same user name and shell name of the row;
# useradd nginx# useradd zabbix# useradd tomcat# useradd hadoop# useradd-s/sbin/nologin nologin# grep-e "(^[[:alnum:]]* \>). *\1$ "/etc/passwd
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/78/7E/wKiom1Z-Lc3QzJMHAAAP5pe_1XM537.png "title=" Image 2.png "alt=" Wkiom1z-lc3qzjmhaaap5pe_1xm537.png "/>
4, find a word in the/etc/rc.d/init.d/functions file (the middle of the word can be underlined) followed by a set of parentheses line;
# grep-e "_[[:alpha:]]*\ (\)"/etc/init.d/functions
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/78/7D/wKioL1Z-MpKwy9HKAAAlfmxDOxs117.png "title=" Image 6.png "alt=" Wkiol1z-mpkwy9hkaaalfmxdoxs117.png "/>
5, use echo to output a path, and then egrep find its path base name; Further use Egrep to remove its directory name (note that the directory name, not the directory path);
(1) Take path base name
# echo "/etc/init.d/functions/" | Egrep-o "[[: alnum:]]*/?$] | Cut-d/-F1
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/78/7E/wKiom1Z-MfqwEMqYAAAIAgAwqyE898.png "title=" Image 5.png "alt=" Wkiom1z-mfqwemqyaaaiagawqye898.png "/>
6. Find all files that are not root, bin or hadoop under the/usr directory;
# find/usr-not \ (-user root-o-user bin-o-user hadoop \)-ls
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/78/7D/wKioL1Z-NNHwfo5CAAAR1ei2QHI430.png "title=" Image 7.png "alt=" Wkiol1z-nnhwfo5caaar1ei2qhi430.png "/>
7, one day the system was invaded, hackers in your system to leave the Trojan file:
You now need to find all the files on the current system that are not owned by the master or group and have been visited in the last week;
In addition, it is necessary to find all files of more than 20k and type ordinary files in/etc directory;
# Find/-nouser-o-nogroup-atime-7
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/78/7D/wKioL1Z-NnHQAk01AAAND0NU7Ts122.png "title=" Image 8.png "alt=" Wkiol1z-nnhqak01aaand0nu7ts122.png "/>
# find/etc-size +20k-type f-exec ls-lh {} \;
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/78/7E/wKioL1Z-STagsQMeAAA5QNTdoyE487.png "title=" Image 12.png "alt=" Wkiol1z-stagsqmeaaa5qntdoye487.png "/>
8, create the directory/test/data, let a group of ordinary users have write permissions to it, and all the files created by the group is the directory belongs to the group; In addition, each user can only delete their own files.
# mkdir-p/test/data# chown hadoop.hadoop/test/data# usermod-g hadoop tomcat# useradd-g hadoop nginx# chmod g+ws,o+t/ Test/data
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/78/7E/wKioL1Z-Q0uy9V60AAAavNZX9Jo416.png "style=" float: none; "title=" Image 10.png "alt=" Wkiol1z-q0uy9v60aaaavnzx9jo416.png "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/78/7F/wKiom1Z-QzXTD60_AAAWBR0RFnc898.png "style=" float: none; "title=" Image 11.png "alt=" Wkiom1z-qzxtd60_aaawbr0rfnc898.png "/>
Linux case (1)