首页 / CENTOS / CentOS 系统基本配置
CentOS 系统基本配置
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了CentOS 系统基本配置,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2694字,纯文字阅读大概需要4分钟。
内容图文
![CentOS 系统基本配置](/upload/InfoBanner/zyjiaocheng/978/d852c006dc694cc789647a0f9ae123f8.jpg)
系统基本配置
建议修改系统环境英文,通过SSH远程工具管理不会出现乱码
vi /etc/sysconfig/i18n
LANG=”en_US”
建议关闭SELINUX
vi /etc/sysconfig/selinux
一、网络配置
1、通过网卡配置文件配置
vi /etc/sysconfig/network-scripts/ifcfg-eth0
2、修改计算机名
vi /etc/sysconfig/network
3、配置DNS
vi /etc/resolv.conf
配置完成后重新启动网络服务
service network restart
4、通过菜单配置网络---TAB切换
setup
配置IP
[root@localhost /]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
UUID=f90d9f87-dc35-4c67-863d-76c8d15f1e4a
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
HWADDR=50:46:5D:73:3C:22
IPADDR=192.168.2.18
PREFIX=24
GATEWAY=192.168.2.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
配置计算机名
[root@localhost /]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=manager
配置DNS
[root@localhost /]# vi /etc/resolv.conf
nameserver 61.139.2.69
配置本地yum源
[root@localhost yum.repos.d]# vi local.repo
[local]
name=local
baseurl=file:///var/centos6.8/
enabled=1
gpgcheck=0
[root@localhost yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, security
Cleaning repos: base extras local updates
Cleaning up Everything
[root@localhost yum.repos.d]# yum makecache
关闭SElinux
[root@localhost yum.repos.d]# vi /etc/selinux/config
SELINUX=disabled
SELINUXTYPE=targeted
更新服务器时间
[root@localhost yum.repos.d]# ntpdate time.windows.com && hwclock -w && hwclock --systohc
14 Jun 16:38:40 ntpdate[2300]: adjust time server 40.69.40.157 offset -0.015351 sec
关闭不用的服务
查看不用的服务
[root@localhost yum.repos.d]# chkconfig --list |egrep -v "crond |haldaemon |iptables |irqbalance |messagebus |netfs |network |rsyslog |sshd |sysstat |udev-post"
编写脚本处理
[root@manager sh]# cat chkconfig.sh
#!/bin/bash
# close service all
for s1 in chkconfig --list |egrep -v "crond |haldaemon |iptables |irqbalance |messagebus |netfs |network |rsyslog |sshd |sysstat |udev-post" |awk '{print $1}'
do
chkconfig $s1 off
done
创建普通用户
[root@manager sh]# useradd xk
[root@manager sh]# passwd xk
Changing password for user xk.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
授权普通用户管理
[root@manager sh]# visudo
root ALL=(ALL) ALL
user ALL=(ALL) ALL
调整文件描述符
[root@manager sh]# vi /etc/security/limits.conf
# soft core 0
# hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4
-
- nofile 65535
[root@manager ~]# ulimit -n
65535
清除登录时显示内核信息
[root@manager ~]# echo >/etc/issue
[root@manager ~]# echo >/etc/redhat-release
内容总结
以上是互联网集市为您收集整理的CentOS 系统基本配置全部内容,希望文章能够帮你解决CentOS 系统基本配置所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。