# 增加超级管理员权限
$: id
uid=500(kevin) gid=500(kevin) groups=500(kevin)
$: sudo -i vi /etc/passwd
kevin:x:500:500::/home/kevin:/bin/bash
$: gid改为0
# 增加不能使用的命令(组):ifconfig
$: vi ~/.bash_profile
PATH=$PATH:$HOME/bin:/sbin
$: source ~/.bash_profile
$: echo $PATH
# 配置自己习惯的指令
$: vi ~/.bashrc
alias cdd=‘cd $OLDPWD --color=tty‘
alias cdr=‘cd /etc --color=auto‘
$: source ~/.bashrc
# 利用挂载(后台)传输文件
$: sudo mount -o username=xxx,password=o //192.168.1.110/iso /dream
$: sudo cp /dream/rhel-server6.5.iso /media/iso/. &
或者
$: sudo cp /dream/rhel-server6.5.iso /media/iso/.
Ctrl+z
$: jobs
$: bg +1
# 自动挂载虚拟光驱
$: sudo mkdir -p /media/Redhat
$: sudo mkdir -p /media/dream
$: sudo mkdir -p /media/iso
$: sudo mount -o username=kevin,password=1 //192.168.1.110/iso /media/dream
$: sudo cp /media/dream/rhel-server6.4-x86_64/media/iso/.
$: sudo vi /etc/rc.d/rc.local
mount -t auto -o loop /media/iso/rhel-server6.4-x86_64 /media/Redhat
# 配置自己的Yum源
$: sudo vi /etc/yum.repos.d/yum.repo
[base]
name=Red Hat Enterprise Linux
baseurl=file:///media/Redhat/Server
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
$: sudo cd /etc/yum.repos.d/
$: sudo mv rhel-source.repo rhel-source.repo.bak
$: sudo yum clean all
$: sudo rm -f /var/cache/yum/x86_64/6Server/base/repomd.xml
$: sudo yum search samba
# 配置网卡地址
$: sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0
ONBOOT=YES
BOOTPROTO=NONE
IPADDR=192.168.1.254
NETWORK=192.168.1.0
NETMASH=255.255.255.0
GATEWAY=192.168.1.1
DNS1=220.113.47.34
$: sudo service network restart
# 修改host name
$: sudo vi /etc/sysconfig/network
HOSTNAME=Pandora.localdomain
# 配置DNS
$: sudo vi /etc/resolv.conf
search localdomain
nameserver 220.113.47.34
# 配置默认启动多用户命令行界面
$: vi /etc/inittab
id:3:initdefault:
# 开机关闭防火墙
$: sudo chkconfig iptables on/off
$: sudo service iptables status/stop/start
# 关闭selinux
$: sudo vi /etc/selinux/config
SELINUX=disabled
$: sudo serivce selinux permissive
# 干掉难用的yum之前注意事项
$: rpm -qa | grep rpm-build
如果没有,记得
$: sudo yum install -y rpm-build*
否则,就哭吧(当时哭了一晚上)
原文:http://www.cnblogs.com/PandoraX/p/zhangqingjun.html