阿里云CentOS服务器设置

· 修改root密码
passwd root

· 创建普通用户
useradd -m xxx
paswd xxx

· 修改HOST NAME
vi /etc/hosts
vi /etc/sysconfig/network
hostname newname

· 普通用户增加sudo权限
修改/etc/sudoers,修改前u+w,在root ALL这一行后面增加一行增加用户名,修改后u-w

· 挂载数据盘
1. 查看数据盘:fdisk -l
2. 分区:fdisk /dev/xvdb 按需输入n p 1 wq
3. 查看分区:fdisk -l
4. 格式化分区:mkfs.ext3 /dev/xvdb1
5. 设置开机自动挂载:echo '/dev/xvdb1  /mnt ext3    defaults    0  0' >> /etc/fstab
6. 挂载新分区:mount -a; df -h

· 修改ssh端口号
vi /etc/ssh/sshd_config

· 进入root
su是半root模式(不执行.bash_profile);su - root完全进入root用户

· 按需禁止开机启动服务
chkconfig xxx off
acpid:笔记本电源管理
cups:打印机相关
firstboot:第一次启动才需要
sendmail:邮件服务

· 按需删除不需要的软件

复制代码
yum groupremove "Games and Entertainment" "System Tools" "Editors" "News Server" 
"DNS Name Server" "FTP Server" "GNOME Desktop Environment" "GNOME Software Development"
"MySQL Database" "Windows File Server" "X Window System" "X Software Development" 
"Web Server" "Office/Productivity" "Graphics" "Graphical Internet" "Text-based Internet" 
"Printing Support" "Dialup Networking Support" "Legacy Network Server" 
"Legacy Software Development" "Legacy Software Support" "Sound and Video" 
"Mail Server" "Eclipse"

yum remove Deployment_Guide-en-US finger cups-libs cups bluez-libs desktop-file-utils 
ppp rp-pppoe wireless-tools irda-utils nfs-utils nfs-utils-lib rdate fetchmail eject 
ksh mkbootdisk mtools syslinux tcsh startup-notification talk apmd rmt dump setserial 
portmap yp-tools ypbind
 
yum remove telnet rsh ftp rcp 

 

 

posted @ 2013-08-24 17:51  easynote  阅读(502)  评论(0编辑  收藏  举报