11、显示/etc/rc.d/rc.sysinit文件中以#开头,后面跟至少一个空白字符,而后又有至少一个非空白字符的行;
[root@CentsOS ~]#grep "^#[[:space:]]\+[^[:space:]]" /etc/rc.d/rc.sysinit
#/etc/rc.d/rc.sysinit - run once at boot time
# Taken in partfrom Miquel van Smoorenburg's bcheckrc.
# Check SELinuxstatus
# Print a textbanner.
# Only read thisonce.
# Initializehardware
# Set defaultaffinity
# Load otheruser-defined modules
# Load modules(for backward compatibility with VARs)
# Configurekernel parameters
# Set thehostname.
# Sync waitingfor storage.
# Device mapper& related initialization
# Start any MDRAID arrays that haven't been started yet
# Remount theroot filesystem read-write.
# Clean upSELinux labels
# If relabeling,relabel mount points.
# Mount all otherfilesystems (except for NFS and /proc, which is already
# mounted).Contrary to standard usage,
# filesystems areNOT unmounted in single user mode.
# Update quotasif necessary
# Check to see ifa full relabel is needed
# Initializepseudo-random number generator
# Configuremachine if necessary.
# Clean out /.
# Do we need (w|u)tmpx files? We don't set them up, but the sysadmin m
# Clean up /var.
# Clean uputmp/wtmp
# Clean upvarious /tmp bits
# Make ICEdirectory
# Start upswapping.
# Set upbinfmt_misc
# Boot timeprofiles. Yes, this should be somewhere else.
# Now that wehave all of our basic modules loaded and the kernel going,
# let's dump thesyslog ring somewhere so we can find it later
# create thecrash indicator flag to warn on crashes, offer fsck with timeout
# Let rhgb knowthat we're leaving rc.sysinit 12、打出netstat-tan命令执行结果中以‘LISTEN’,后或跟空白字符结尾的行; 13、添加用户bash,testbash, basher, nologin (此一个用户的shell为/sbin/nologin),而后找出当前系统上其用户名和默认shell相同的用户的信息;
1、 添加用户
[root@CentsOS ~]# useradd bash
[root@CentsOS ~]# useradd testbash
[root@CentsOS ~]# useradd basher
[root@CentsOS ~]# useradd nologin –s /sbin/noligin
2、查看添加用户情况。
[root@CentsOS ~]# cat /etc/passwd
bash:x:501:501::/home/bash:/bin/bash
testbash:x:502:502::/home/testbash:/bin/bash
basher:x:503:503::/home/basher:/bin/bash
nologin:x:504:504::/home/nologin:/sbin/nologin
3、过滤出其用户名与默认SHELL相同的用户的信息。
[root@CentsOS ~]# grep "^\([[:alnum:]]\+\>\).*\1$"/etc/passwd
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
bash:x:501:501::/home/bash:/bin/bash
nologin:x:504:504::/home/nologin:/sbin/nologin