#FIND
1’mkdir -p /root/find
2’find /home -user tom -exec cp -a {} /root/find \;
[-a 保留原文件属性]
3’cd /root/find
#grep
Find key word root in /etc/passwd ,and the result to record in /root/grep.txt
1’grep root /etc/passwd >/root/grep.txt
2’cat /root/grep.txt
#swap
Create a swap division ,size 512M, Realize boot automatically mount
1’fdisk –l
2’fdisk -cu /dev/sda p n +512M t 3 82 w
3’reboot
4’mkswap –c /dev/sda3; swapon –a /dev/sda3
5’blkid /dev/sda3
6’vim /etc/fstab
UUID=****************** swap awap defaults 0 0
7’mount –a
#lvm创建
Create a VG named datastore ,LV named database
VG PE :50 ,size of PE: 16M LV : the number of LE :50
1’fdisk -cu /dev/sda [根据50个PE(16M),确定分区大小] p n +816M t 5 8e w
2’reboot
3’pvcreat /dev/sda5
4’vgcreate datastore -s 16M /dev/sda5
5’lvcreate -n database -l 50 /dev/datastore
6’vgdisplay; lvdisplay
#计划任务
crontab -e -u tom
分时日月周 命令
RHCE
#SELINUX
1’ vim /etc/sysconfig/selinux
2’ getenforce
#路由
Open the local routing forwarding function
1’vim /etc/sysctl.conf
2’sysctl -p [查看]
#计划任务
1’vim /etc/cron.deny
#FTP
Allow anonymous users to upload files to /pub ,192.168.0.0/24can visit only
1’vim /etc/vsftpd/vsftpd.conf 27 31
2 ‘service vsftpd restart ; chkconfig vsftpd on
3’ 防火墙设置
service iptables start;chkconfig iptables on
iptables –nL(默认拒绝所有)
vim /etc/sysconfig/iptables-config
iptables -I INPUT -p tcp --dport 21 -s 192.168.0.0/24 -j AECCEPT
service iptables save
4’ 布尔值设置
getsebool -a | grep ftp
Setsebool -P allow_ftpd_full_access on [永久生效]
5’cd /var/ftp/; chmod o+w pub/
6’touch file2 ; lftp 192.168.0.9 ; put file2
#SMTP
The remote user can use your mail service, ensure that the individual user E-mail storage in/var/spool/mail.
1’yum -y install postfix
2’ vim /etc/postfix/main.cf
; 将localhost注释。
3’service postfix restart ; chkconfig postfix on
4’netstat -tlnup |grep :25
5’防火墙设置
Iptables –I INPUT –p tcp –dport 25 –s 0.0.0.0/0 –j ACCEPT
service iptables save
6’yum –y install nc*; nc 192.168.0.100 25
#邮件别名
The mail send to admin ,can be send to tom and mike.
1‘vim /etc/aliases
2’newaliases
