linux防火牆關閉與中文顯示亂碼排錯
阿新 • • 發佈:2019-01-09
PS1
PS1主要用來控制命令列的樣式
如:
\u:代表當前使用者 whoami
\h:代表當前主機名 hostname
\W:代表當前位置 pwd
修改PS1
SElinux
查詢SElinux狀態
SElinux的三種狀態:
Enforcing:表示SElinux正在執行
Permissive:表示SElinux臨時關閉
disabled:表示SElinux徹底關閉
臨時關閉SElinux
[[email protected] ~]# setenforce 0
如遇到setenforce: setenforce() failed,表示許可權不足,需要在root使用者下執行setenforce 0
永久關閉SElinux
修改配置檔案,/etc/selinux/config,將SELINUX=enforcing修改成SELINUX=disabled,然後重啟計算機即可
iptables(防火牆)
查詢狀態
[[email protected] ~]# /etc/init.d/iptables status
臨時關閉
[[email protected] ~]# /etc/init.d/iptables stop
永久關閉
設定開機不自動啟動,使用命令chkconfig iptables off,如需要改成開機自動啟動將off改成on即可。
linux顯示中文亂碼排錯
檢視系統字符集
使用echo $LANG命令來進行檢視
臨時修改系統字符集
使用export LANG=字符集來進行修改
永久修改系統字符集
修改配置檔案/etc/sysconfig/i18n檔案中的LANG,然後使用source /etc/sysconfig/i18n來生效