centos普通用户加入root用户组
修改 /etc/sudoers 文件,找到下面一行,在root下面添加一行,如下所示:
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
yourname ALL=(ALL) ALL
centos查询系统中已安装的软件
rpm -qa
rpm包安装
rpm -ivh {rmp文件}
修改centos系统默认启动级别
修改文件/etc/inittab下面的内容
id:5:initdefault:
不同级别数值的含义
# Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
设置网卡混合模式
ifconfig bond0 promisc
强制网卡重新获取dhcp地址
dhclient eth0
查看端口是否被占用
netstat -tunlp | grep 22
linux配置默认网关
route add default gw $gateway
route del -net 0.0.0.0 netmask x.x.x.x dev eth0