Common linux commands + turn on/off firewall

Linux commonly used commands

Mkdir created

Rm -rf delete

Chmod -R 777 permissions

Mysql -uroot -r

quit exit

 

find / -name svn find location

 

Turn off the firewall and selinux

Redhat uses SELinux to enhance security. The way to close it is:

1. Permanently effective

Modify SELINUX="" in the /etc/selinux/config file to be disabled, and then restart.

2. Effective immediately

setenforce 0

 

The method to turn off the firewall is:

1. Permanently effective

Turn on: chkconfig iptables on

Close: chkconfig iptables off

2. Effective immediately, invalid after restart

Open: service iptables start

Close: service iptables stop

 

It should be noted that other services under Linux can be opened and closed with the above commands

 

supplement:

a. The firewall also needs to turn off the ipv6 firewall:

chkconfig ip6tables off

And you can check the status through the following command:

chkconfig --list iptables

b. The status of selinux can be viewed with the following command:

Sestatus

===============

 

# uname -a # View kernel/ operating system /CPU information 
# head -n 1 /etc/issue # View operating system version 
# cat /proc/cpuinfo # View CPU information 
# hostname # View computer name 
# lspci -tv # List All PCI devices 
# lsusb -tv # List all USB devices 
# lsmod # List loaded kernel modules 
# env # View environment variable resources 
# free -m # View memory usage and swap area usage 
# df -h # View each Partition usage 
# du -sh <directory name> # View the size of the specified directory 
# grep MemTotal /proc/meminfo # View the total amount of memory 
# grep MemFree /proc/meminfo # View the amount of free memory 
# uptime # View the system running time and users Number, load 
# cat /proc/loadavg # View system load disks and partitions 
# mount | column -t # View mounted partition status 
# fdisk -l # View all partitions 
# swapon -s # View all swap partitions 
# hdparm -i /dev/hda # View disk parameters (only for IDE devices) 
# dmesg | grep IDE # View the IDE device detection status network at startup 
# ifconfig # View the properties of all network interfaces 
# iptables -L # View firewall settings 
# route -n # View routing table 
# netstat -lntp # View all listening ports 
# netstat -antp # View all established connections 
# netstat -s # View network statistics process 
# ps -ef # View all processes 
# top # Display process status in real time User 
# w # View active users 
# id <User name> # View specified User information 
# last # View user login logs 
# cut -d: -f1 /etc/passwd # View all users in the system 
# cut -d: -f1 /etc/group # View all groups in the system 
# crontab -l # View the current user's Scheduled Task Service 
# chkconfig –list # List all system services 
# chkconfig –list | grep on # List all started system service programs 
# rpm -qa # View all installed packages

Guess you like

Origin blog.csdn.net/hety119/article/details/88314016