安裝完CentOS 6後須檢查事宜


1. disable firewall:mysql

service iptables stop
linux

chkconfig iptables off; chkconfig ip6tables offsql


2. disable selinuxubuntu

setenforce 0
centos

sed -i 's,SELINUX=enforcing,SELINUX=disabled,g' /etc/selinux/config
app


3. enable network servicessh

service NetworkManager stop; chkconfig NetworkManager off; service network restarttcp


vi /etc/sysconfig/network-scripts/ifcfg-eth0ide

NM_CONTROLLED=no
url


4. reboot

repository for CentOS 6:

cat << EOF > /etc/yum.repos.d/iso.repo
[iso]
name=iso
baseurl=http://mirrors.aliyun.com/centos/6.6/os/x86_64
enable=1
gpgcheck=0
EOF

cat << EOF > /etc/yum.repos.d/updates.repo
[updates]
name=updates
baseurl=http://mirrors.aliyun.com/centos/6.6/updates/x86_64
enable=1
gpgcheck=0
EOF


cat << EOF > /etc/yum.repos.d/epel.repo
[epel]
name=epel
baseurl=http://mirrors.aliyun.com/epel/6Server/x86_64
enable=1
gpgcheck=0
EOF


repository for CentOS 7:

cat << EOF > /etc/yum.repos.d/iso.repo
[iso]
name=iso
baseurl=http://mirrors.aliyun.com/centos/7/os/x86_64
enable=1
gpgcheck=0
EOF

cat << EOF > /etc/yum.repos.d/updates.repo
[updates]
name=updates
baseurl=http://mirrors.aliyun.com/centos/7/updates/x86_64
enable=1
gpgcheck=0
EOF


cat << EOF > /etc/yum.repos.d/epel.repo
[epel]
name=epel
baseurl=http://mirrors.aliyun.com/epel/7/x86_64
enable=1
gpgcheck=0
EOF


修改時區-Timezone

rm -rf /etc/localtime

ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 

vi /etc/sysconfig/clock

ZONE="Asia/Shanghai"


CentOS 6.6 iptables rules:

service iptables start; chkconfig iptables on

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p icmp -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited
iptables -A FORWARD -j REJECT --reject-with icmp-host-prohibited

service iptables save; service iptables restart


make template for CentOS 6 within vmware workstation:

ubuntu
1). vi /etc/hosts to remove 127.0.1.1. item
2). enable ssh login
3). enable dhcp client on interface
4). enable normal username/password
5). set root password

centos/redhat
1). rm -rf /etc/ssh/ssh_host_*
2). vi /etc/sysconfig/network-scripts/ifcfg-ethX to remove HWADDR and UUID items
3). rm -rf /etc/udev/rules.d/70-persistent-net.rules
4). enable ssh login
5). enable dhcp client on interface (also vi /etc/sysconfig/network, /etc/resolv.conf)

6). enable normal username/password
7). set root password


create bridge network card:   http://hj192837.blog.51cto.com/655995/1033378


使用Navicat鏈接Mysql

ensure to open 3306 port or disable iptables


mysql -uroot -p
mysql> GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'your password';
mysql> flush privileges;


SSH免密登陸:

ssh-keygen -q -t rsa -f ~/.ssh/id_rsa -C '' -N ''

ssh-copy-id xxx

相關文章
相關標籤/搜索