2016年11月5日 星期六

(under construction)Linux指令筆記

隨手放一些常常忘記的指令以備不時之需~

1. 查看系統版本
#uname -a

2. 檢查SELinux (Security Enhanced Linux) 狀態
#getenforce

→修改SELinux狀態
#vim /etc/selinux/config
修改SELINUX=enforcing
SELinux的模式可分為三種模式,以下取自於鳥哥的Linux私房菜
  1. enforcing:強制模式,代表 SELinux 運作中,且已經正確的開始限制 domain/type 了。
  2. permissive:寬容模式:代表 SELinux 運作中,不過僅會有警告訊息並不會實際限制domain/type 的存取。
  3. disabled:關閉,SELinux 並沒有實際運作。
3. 修改ip
#ifconfig <device_name> <ip_addr> 
其他網卡資料的修改

#vim /etc/sysconfig/network-scripts/<device_name>

4. hostname
檢查hostname
#hostnamectl

修改hostname
CentOS 7更新了修改hostname的方法,現在只需要
# hostnamectl set-hostname <new_hostname>

沒有留言:

張貼留言