Bài viết sau đây hướng dẫn Centos 6.5 cấu hình cơ bản. Cấu hình IP tĩnh,Firewall cơ bản v.v.v
Links:Dòng lệnh hữu ích trong linux
Umask và thiết lập umask trong linux
Centos 6.5 tạo User và Group Basic đến Advance
Centos 6.5 cấu hình cơ bản
Hình Ảnh trên một số Centos 6.5 cấu hình cơ bản. :))) p>
1.Create User
Create user admin
[root@mail ~]# useradd huu
[root@mail ~]# passwd huu
Changing password for user huu.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
Chỉ cho phép user huu switch qua root như administrator user su mặc định là super user. dòng lệnh su sử dụng switch user khác trong login session. Giới hạn user sử dụng dòng lệnh su.
[root@mail ~]# usermod -G wheel huu
[root@mail ~]# vi /etc/pam.d/su
# uncomment the following line
auth required pam_wheel.so use_uid
auth include system-auth
account sufficient pam_succeed_if.so uid = 0 use_uid quiet
account include system-auth
password include system-auth
session include system-auth
session optional pam_xauth.so
Forward mail root đến user administrator
[root@mail ~]# vi /etc/aliases
# Person who should get root's mail
root: huu
[root@mail ~]# newaliases # Configuration change
2.Enable / Disable Firewall && SElinux
Firewall iptables
[root@mail ~]#service iptables status : kiểm tra trạng thái của firewall
[root@mail ~]#service iptables start : enable firewall
[root@mail ~]#service iptables restart : restart firewall
[root@mail ~]#service iptables stop : stop firewall
Selinux
[root@mail ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
Reboot lại hệ thống :)) .
3.Networking
[root@mail ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
IPADDR=192.168.1.5
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
HWADDR=00:0C:29:9C:AE:41
TYPE=Ethernet
UUID=b04c6559-fc7f-439b-92b6-6dc0a144772a
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
#DNS server's IP address
DNS1=8.8.8.8
IPV6INIT=no
USERCTL=no
[root@mail ~]# service network start
[root@mail ~]# chkconfig network on
Disable IPv6 nếu không muốn sử dụng
[root@mail ~]# vi /etc/sysctl.conf
# add at tha last line
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
# reload
[root@mail ~]# sysctl -p
Kết luân: Bài viết trên, Centos 6.5 cấu hình cơ bản. Update thêm. :))







No comments:
Post a Comment