1、网络管理
RHEL6的网络管理通过NetworkManager服务来实现。
检查NetworkManager服务的运行状态:service NetworkManager status
启动: service NetworkManager start 停止: service NetworkManger stop
要保证每次登陆都自动运行NetworkManger,使用命令: chkconfig NetworkManager on
图形管理方式:通过右上角的图标进行管理,如果右上角没有显示,通过命令: nm-applet &打开
命令管理方式:nm-connection-editor & 打开
网络连接分两种:用户级连接和系统级连接
系统级连接的配置文件放在/etc/sysconfig/network-scripts/ifcfg-<network_type>中
2、服务
如果想要新服务能被访问,必须同时设置firewall和SELinux
系统的运行级别:
0:用来关闭系统,这种服务系统预留并不允许改变
1:用在单用户模式下,系统预留并不允许改变
2:默认不被使用,用户可以自由定义
3:运行在完全多用户模式下的命令行模式
4:默认不被使用,用户可以自由定义
5:运行在完全多用户模式下的图形界面
6:用来重启服务,系统预留并不允许改变
查看当前系统运行级别:runlevel
系统的默认运行级别通过修改/etc/inittab文件来实现,有类似这样一行代码:id:5:initdefault:
要改变它必须有root权限,通过vi或者nano打开
2.1 配置服务
2.1.1 使用Service Configurator Utility
通过Service Configurator工具,通过System -》Administration -》 Services或者system-config-services命令来启动
所有的服务都在/etc/rc.d/init.d/列举出来
2.1.2 使用ntsysv工具
注意:使用ntsysv工具实际上并没有运行或者停止服务,如果想要立即运行服务的话,使用service命令
2.1.3 使用chkconfig工具
列举所有服务的设置,用chkconfig或者 chkconfig –list
查看选定名字的服务的设置,用chkconfig –list <service>
使服务在level3和level5可用: chkconfig <service> on –-level 35.。注意:服务在下次进入这些运行级别时启动,如果想要立即启动,用service命令。
设置服务不可用: chkconfig <service> off –-level 35
2.2 服务控制
service <service> start/stop/restart/status
3 用户和群组管理
3.1 使用图形工具进行管理:system-config-user
3.2 使用命令行:
useradd <username>
passwd <username>
groupadd <groupname>
chage
4 系统监控
4.1 收集系统信息
ps ax -----display a list of current system processes
ps aux -----
ps ax | grep emacs
top --list of current system process and important info, real-time and interactive
图形界面:gnome-system-monitor
4.2 内存使用
free -------
4.3 文件使用
df -------
5、包管理
5.1RPM
RPM有5中基本操作模式:installing,uninstalling,upgrading,querying,verifying
rpm包文件名类似于: tree-1.5.3-2.el6.x86_64.rpm. The file name includes the package name (tree), version
(1.5.3), release (2), operating system major version (el6) and CPU architecture (x86_64).
installing and upgrading:
rpm –Uvh tree-1.5.3-2.el6.x86_64.rpm
-U:upgrading existing older package or installing new package
-vh:display information and progress
最佳实践:安装非核心包时使用rpm –U ,安装核心包时使用rpm –i
rpm –Uvh –-replacepkgs
rpm –Uvh –replacefiles
uninstalling:
rpm –e tree
querying:
rpm –q tree
-a ?queries all currently installed packages.
-f <file_name> ?queries the RPM database for which package owns <file_name> .
Specify the absolute path of the file (for example, rpm -qf /bin/ls instead of rpm -qf ls).
-p <package_file> ?queries the uninstalled package <package_file> .
There are a number of ways to specify what information to display about queried packages. The
following options are used to select the type of information for which you are searching. These are
called the Package Query Options.
-i displays package information including name, description, release, size, build date, install date,
vendor, and other miscellaneous information.
-l displays the list of files that the package contains.
-s displays the state of all the files in the package.
-d displays a list of files marked as documentation (man pages, info pages, READMEs, etc.) in the
package.
-c displays a list of files marked as configuration files. These are the files you edit after installation
to adapt and custo
浙公网安备 33010602011771号