標籤:centos linux 初始化
修改使用者密碼:
passwd
修改linux主機名稱
vi/etc/sysconfig/network
vim/etc/host
主機名稱立即生效
hostname
selinux和防火牆
Redhat使用了SELinux來增強安全,關閉的辦法為:
1.永久有效
修改/etc/selinux/config檔案中的SELINUX=""為disabled,然後重啟。
2.即時生效
setenforce 0
關閉防火牆的方法為:
1.永久性生效
開啟:chkconfig iptables on
關閉:chkconfig iptables off
2.即時生效,重啟後失效
開啟:service iptables start
關閉:service iptables stop
配置nameserver,確保能串連網路
ping www.baidu.com
ping 202.108.22.5
vi/etc/resolv.conf
nameserver 8.8.8.8
nameserver 114.114.114.114
配置163的yum源
yum -y install wget
cd /etc/yum.repos.d/
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
重啟linux
reboot
安裝scp,vim命名
yum -y install openssh-clients vim
需要說明的是對於Linux下的其它服務都可以用以上命令執行開啟和關閉操作
補充:
a.防火牆還需要關閉ipv6的防火牆:
chkconfig ip6tables off
並且可以通過如下命令查看狀態:
chkconfig--list iptables
b.selinux狀態可以通過以下命令查看:
sestatus
本文出自 “雪藤六” 部落格,請務必保留此出處http://879100963.blog.51cto.com/6686639/1703426
Centos系統初始化