天天看點

Linux 常用指令

檢視使用者和使用者組

cut -d : -f 1 /etc/passwd|grep apache;

cut -d : -f 1

檢視使用者操作:w指令(需要root權限)

檢視某一使用者:w 使用者名

檢視登入使用者:who

檢視使用者登入曆史記錄:last

#/sbin/iptables -I INPUT -p tcp –dport 80 -j ACCEPT

#/sbin/iptables -I INPUT -p tcp –dport 22 -j ACCEPT

#/etc/rc.d/init.d/iptables save

這樣重新開機計算機後,防火牆預設已經開放了80和22端口

這裡應該也可以不重新開機計算機:

#/etc/init.d/iptables restart

防火牆的關閉,關閉其服務即可:

檢視防火牆資訊:

#/etc/init.d/iptables status

關閉防火牆服務:

#/etc/init.d/iptables stop

永久關閉?不知道怎麼個永久法:

#chkconfig –level 35 iptables off

關閉 SELinux 

setenforce 0

繼續閱讀