CentOS4服务器安装后的初期设定

CentOS4 初期初期设定
(1)使用用户root登陆和退出
linux login: root ← 输入登陆用户名root
Password:  ← 输入用户的密码(输入时,密码不被显示)
 
[root@centos ~]#  ← 使用root登陆后的状态
 
[root@centos ~]# exit ← 退出
 
linux login: ← 退出后的状态
 
(3)本地控制台操作乱码的对策
因为在本地控制台操作时有乱码,所以安装bterm
[root@centos ~]# ls -l ← 输入ls命令查看
以下内容乱码时显示成
■■ 92
-rw------- 1 root root 1215 6■ 16 10:27 anaconda-ks.cfg
-rw-r--r-- 1 root root 66219 6■ 16 10:27 install.log
-rw-r--r-- 1 root root 3836 6■ 16 10:27 install.log.syslog
 
[root@note ~]# yum -y install bogl-bterm ← 安装bogl-bterm
 
[root@centos ~]# modprobe vga16fb ← 导入frame buffer用的组件
 
[root@centos ~]# lsmod |grep vga16fb ← 组件导入确认
vga16fb                12969 1 
vgastate                9409 1 vga16fb
 
[root@centos ~]# echo "modprobe vga16fb" >> /etc/rc.local ← 系统启动时组件自动启动
 
[root@centos ~]# export PS1='[/u@/h /W]# ' ← shell表示设定
 
[root@centos ~]# echo "export PS1='[/u@/h /W]# '" >> /etc/profile ← 再次登陆时shell自动表示的设定
 
[root@centos ~]# bterm ← 执行bterm
 
[root@centos ~]# ls -l  输入ls命令查看结果确认
合計 92
-rw------- 1 root root 1215 6月 16 10:27 anaconda-ks.cfg
-rw-r--r-- 1 root root 66219 6月 16 10:27 install.log
-rw-r--r-- 1 root root 3836 6月 16 10:27 install.log.syslog
 
[root@centos ~]# exit ← bterm終了する場合
 
(3)用户的创建和删除
[root@centos ~]# useradd centos ← 创建用户centos
 
[root@centos ~]# passwd centos ← 设定用户centos的密码
Changing password for user centos.
New UNIX password:  ← 输入用户centos的密码
Retype new UNIX password:  ← 再次输入centos的密码
passwd: all authentication tokens updated successfully.
 
[root@centos ~]# userdel -r centos ← 用户centos删除
 
(4)在一般用户下切换到root用户
[centos@linux ~]$   使用centos用户登陆后的状态
 
[centos@linux ~]$ su -  使用su命令切换到root(不要忘记输入-)
Password:  ← 输入root用户的密码
 
[root@centos ~]#  ← 变成了root用户
 
[root@centos ~]# exit ← root用户切换到一般用户
 
[centos@linux ~]$  ← 返回到一般用户centos
 
root 用户没有权限制约 , 可能因为误操作删除重要文件 , 所以一般都是使用一般用户 . 只有在必要的情况下才使用 su 命令切换到 root 用户 .
(5)把root用户变成管理者
例如:管理者使用的一般用户名变成centos
[root@centos ~]# usermod -G wheel centos ← 把管理者用户追回到wheel
 
[root@centos ~]# vi /etc/pam.d/su
#auth       required     /lib/security/$ISA/pam_wheel.so use_uid
auth       required     /lib/security/$ISA/pam_wheel.so use_uid ← 删除掉#
 
[root@centos ~]# echo "SU_WHEEL_ONLY yes" >> /etc/login.defs ← 追回到最后一行
 
(6)package管理系统的设定
进行RPM package的安装,删除操作的命令yum的初期设定
[root@centos ~]# yum -y install yum-plugin-fastestmirror ← 安装fastestmirror插件
package安装时(download)自动选择对应的网站
 
[root@centos ~]# echo plugins=1 >> /etc/yum.conf ← yum插件有效
 
[root@centos ~]# yum -y update ← 已经安装的package全部更新
 
[root@centos ~]# /etc/rc.d/init.d/yum start ← 已经安装的package自动更新脚本的启动
 
[root@centos ~]# chkconfig yum on ← 设定已经安装的package自动更新脚本的自动启动
 
[root@centos ~]# chkconfig --list yum ← 设定已经安装的package自动更新脚本的自动启动确认
yum             0:off   1:off   2:on    3:on    4:on    5:on    6:off ← 确认2-5on的状态
 
[root@centos ~]# yum -y remove up2date ← 删除up2date
 
(7)给root用户转送邮件
因为系统重要的邮件都转送给了root用户,平时使用邮件地址转送.
[root@centos ~]# sed -i '/^root:/d' /etc/aliases ← 删除旧的root转送mail设定
 
[root@centos ~]# echo "root: hoge@nifty.com" >> /etc/aliases ←  转送到普通的邮件地址(例:hoge@nifty.com)
 
[root@centos ~]# newaliases ← 转送设定生效
/etc/aliases: 77 aliases, longest 25 bytes, 794 bytes total
 
[root@centos ~]# echo test|mail root ← 测试邮件发送到root邮箱
 
(8)locate命令使用的DB设定成自动更新
[root@centos ~]# vi /etc/updatedb.conf ← 编辑locate命令DB更新设定文件
DAILY_UPDATE=no
DAILY_UPDATE=yes ← 修改成yes
 
(9)系统的停止和再启动
[root@centos ~]# halt  系统停止
 
[root@centos ~]# reboot  系统再启动
 
 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值