The Linux society is basically okay.

Source: Internet
Author: User

1,linux Inner Shell file: cat/etc/issue or/etc/redhat-release
Ubuntu[apt-get install-y vim] Centos[yum install-y vim] [sudo yum install epel-release]update install list
2, can apt-get update, apt-get-y upgrade yum-y upgrade Yum update
3,service Start Method:sudo service docker start = =/etc/init.d Docker start = = Systemctl Docker start
4,firewall is OK. Chkconfig iptables--list |service iptables start

user:===== Cat/etc/passwd/etc/shadow/etc/group
1,useradd-d/home/jianyeruan Jianyeruan
2,passwd
3,usermod-a-G Jianyeruan root can be used without action.
4,vi/etc/sudoers
Jianyeruan all= (All) all
5,service sshd Restart
6,shutdown-r now OK after doing 6.
7
Disable root
/etc/ssh/sshd_config
Permitrootlogin No

File. permission=======================
Ugo==a rwx
CHOMD a+r ABC
chmod U=RWX,G=RX,O=RX ABC: ibid. u= User Rights, g= group permissions, o= different groups of other user rights
chmod u-x,g+w ABC: for ABC to remove user-executed permissions, increase group Write permissions
Chomd-r A+r * Recursively traversing sub-directories [-R]

8,command:
Find/-name php.ini | | Netstat-ntld | | Lsof-i tcp:80 | | Kill-9 $ (pgrep nginx) | | Ps-eo Pid,user,group,args,etime,lstart
9,autorun root User Plus
Vi/etc/rc.local
Touch/var/lock/subsys/local
sudo service php-fpm start
sudo service nginx start
10.time
How to start the cron process:/etc/init.d/crond start
Start the Cron Process Setup command: Chkconfig--add crond
Method Two:
Add cron to the startup script:
# rc-update Add Vixie-cron Default
Crontab-l #查看你的任务
crontab-e# Edit Your task
crontab-r# Delete the contents of a user's crontab
Day of the week February 2 1 o'clock dry time-sharing what to do Sunday
0 1 2 2 1 1 0
Example:
0 4 * * 0 root emerge--sync && emerge-ud World #每周日凌晨4点, update system
0 2 1 * * Root rm-f/tmp/* #每月1号凌晨2点, clean up files in/tmp
0 8 6 5 * Root mail Robin If, I want to execute a command every 2 minutes, or I want to execute commands at 6, 12, 18, and so on every day, the cycles can be set by "/" and ",":
*/2 * * * * * Root ... #每两分钟就执行 ......... .....
0 6,12,18 * * * * Root ... #每天6点, 12, 18, ...., .....-No, No.
Every two hours
0 */2 * * * echo "has a break now." >> /tmp/test.txt
Every two hours between 11 o'clock and 8 in the morning, eight in the morning.
0 23-7/2,8 * * * echo "a good Dream:)" >> /tmp/test.txt
Every month, number 4th and Monday to Sunday, three in the morning at 11.
0 4 * 1-3 command line
January 1 morning, 4.
0 4 1 1 * command line

=========firewall Config==========sudo vi/etc/sysconfig/iptables===
: INPUT ACCEPT [0:0]
: FORWARD ACCEPT [0:0]
: OUTPUT ACCEPT [0:0]
-A input-m state--state related,established-j ACCEPT
-A input-p icmp-j ACCEPT
-A input-i lo-j ACCEPT
-A input-p tcp-m state--state new-m TCP--dport 22-j ACCEPT
-A input-p tcp-m state--state new-m TCP--dport 80-j ACCEPT
-A input-p tcp-m state--state new-m TCP--dport 9000-j ACCEPT
-A input-p tcp-m state--state new-m TCP--dport 11211-j ACCEPT
-A input-p tcp-m state--state new-m TCP--dport 22999-j ACCEPT
-A input-p tcp-m state--state new-m TCP--dport 3000-j ACCEPT
-A input-p tcp-m state--state new-m TCP--dport 9696-j ACCEPT
-A input-p tcp-m state--state new-m TCP--dport 27017-j ACCEPT
-A input-j REJECT--reject-with icmp-host-prohibited
-A forward-j REJECT--reject-with icmp-host-prohibited
COMMIT
=========download============
wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.7-p334.tar.gz
Tar xvf ruby-1.8.7-p334.tar.gz
CD ruby-1.8.7-p334
./configure
Make && make install

The Linux society is basically okay.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.