当前位置首页 > 人力资源/企业管理 > 职业培训
搜柄,搜必应! 快速导航 | 使用教程  [会员中心]

2023年Solaris系统管理员培训

文档格式:DOC| 173 页|大小 353.50KB|积分 20|2022-11-02 发布|文档ID:167074337
第1页
下载文档到电脑,查找使用更方便 还剩页未读,继续阅读>>
1 / 173
此文档下载收益归作者所有 下载文档
  • 版权提示
  • 文本预览
  • 常见问题
  • Solaris系统管理员培训第一章:系统概念(System Concepts) 1第二章 OpenBoot PROM 2第三章 安装Solaris操作系统 6第四章 软件包管理 7第五章 补丁维护 10第六章 启动过程 11第七章 系统安全 13第八章 用户管理 17第九章 初始化文献管理 18第十章 进程控制 18第十一章 磁盘配置和命名 19第十二章 磁盘、分区和格式化 21第十三章 文献系统介绍 22第十四章 文献系统挂接 25第十五章 网络文献系统 26第一章 系统概念(System Concepts) l 操作系统的重要三个部分 UNIX操作系统是基于文献的,操作系统的重要三个部分是: Kernel Shell File structure 1. Kernel 是操作系统的核心,它的重要功能是: 管理系统的设备、内存、进程以及守护进程 系统程序与系统硬件之间接口 执行所有的命令 管理: Swap space(互换分区) – 系统运营时保存的一部分磁盘空间 Daemons (守护进程)– 解决特定的系统任务 2. shell 是用户与kernel之间的接口。

    它就像是命令的解释器或翻译器Shell接受你输入的命令,对你的输入作出解释,然后就将它发送给kernel执行 操作系统的 Shells种类 Solaris系统中有三种shell: Bourne shell ($) – 这是Solaris的缺省shellBourne shell为 AT&T UNIX 环境而开发/usr/bin/sh) Korn shell ($) – 是Bourne shell的一个超级它增长了一些功能,如:别名、历史记录以及命令行编辑等/usr/bin/ksh) C shell (%) –C shell的语法类似于C语言,并且,C shell有些功能与 Korn shell相类似/usr/bin/csh) 3. 文献组织结构Solaris环境的文献结构是提成的目录树结构,类似于DOS的文献结构是一些有特定目的而组织在一起的目录、子目录和文献 目录 (Directory) – 其他目录和文献所在处 子目录(Subdirectory) – 属于其他目录的所有目录 根目录(/)位于目录树的最顶层,包含 : /usr目录包含系统的一些命令、工具、库文献等 。

    /opt目录包含的三方应用软件 /dev目录包含诸如磁盘、键盘、磁带机、显示器等地设备驱动程序 /etc目录包含系统配置文献,如用户口令文献等等 /export目录一般包含用于NFS共享的目录 /export/home目录包含用户的个人主目录 /kernel目录包含系统结构的kernel文献这个目录下的文献genunix是系统的UNIX kernel 虚拟内存操作系统——互换分区(Swap Space) 虚拟内存操作系统增大了物理内存,它将硬盘中的一部分空间用于存储暂时不用内存数据这块硬盘空间叫做互换分区与Windows下的SWAP文献的功能相似 l 守护进程(Daemons) 守护进程是在后台运营的程序,它负责系统的某个特定的功能,比如打印 系统管理的一些常见的概念: 主机(Host) – 网络环境下的某台计算机系统 主机名(Host name) – 某台系统的名字,网络中的任何系统都必须有自己的主机名 IP地址(IP address) – 网络软件用于鉴别网络中某台机器的一个数字符号 客户机(Client) – 使用网络中一个和多个服务的主机和进程。

    服务器(Server) – 在网络中提供一个或多个服务的主机和进程 网络(Network) – 许多机器连接在一起、可以互相通信的集合 Solaris有下列特性: 多任务(Multitasking) – 多个进程或应用程序可以同时运营 多用户(Multiuser) – 同时可以有多个用户访问系统资源 分布解决(Distributed processing) – 通过网络使用资源 第二章 OpenBoot PROMl OpenBoot PROM介绍 所有Sun机器都一个用于基本硬件测试和初始化的固件,尚有一个提供多种重要功能的用户程序 1. 基本元素 Sun系统的基本硬件元素涉及: Boot PROM芯片,它永久的固定在主板中 非易失性随机访问内存(non-volatile random access memory (NVRAM) )芯片,包含主机的基本信息 2. Boot PROM功能boot PROM有以下功能: 加电自检(Power-on self-tests (POST)) 系统重起始开始执行 检测基本CPU板 因机器型号不同而不同。

    设备驱动 有一些小型设备驱动程序,使得启动的初始化过程中可以与不同的外围设备相通讯 用户操作界面 3. NVRAM 内容 除了永久性存在地以太网地址、主机ID、时钟外,还保存着可以修改的系统的配置参数 Basic Boot PROM Commands ok banner ok boot ok help ok printenv ok setenv ok set-defaults ok probe-scsi ok probe-scsi-all ok probe-ide ok reset banner命令和参数banner命令列出系统得一些参数,比如有那些模块,内存,解决器,以太网卡地址,hostid等信息并且你可以通过banner命令获得PROM得版本号ok banner Sun UltraSPARC 60 UPA/PCI (2 X UltraSPARC-II 296MHz), Keyboard Present OpenBoot 3.11, 256 MB memory installed, Serial #3159808. Ethernet address 8:0:22:1a:e7:3f, Host ID: 72303700. ok boot 命令和参数 您可以在boot命令后键入一个或多个参数。

    这些参数传递改操作系统内核,将影响整个启动过程 命令格式 ok boot [device_name] - [options] 参数 a 交互式启动系统提醒输入根设备和互换设备以及一些重要的系统文献 r 启动时系统将重新查找所有的设备,在/devices和/dev目录下重新生成文 件,更新/etc/path_to_inst文献 s 系统启动后停留在S运营级别可以用来系统错误排除 v 具体地显示出系统的启动信息有时可以用来系统的错误排除 printenv 命令 printenv命令显示NVRAM的参数以及参数的缺省值 查看缺省启动设备 您可以使用printenv显示缺省启动设备 ok printenv Parameter Name Value Default Value tpe-link-test? True true output-device ttya screen input-device ttya keyboard sbus-probe-list f0123 f0123 keyboard-click? False false diag-file diag-device net net boot-file boot-device disk disk auto-boot? true true More [,,q] ? q 您可以在系统的输出中查看缺省启动设备,参数是boot-device。

    您也可以输入printenv boot-device,这样只显示启动设备的值 重新定义PROM Boot值 使用setenv命令可以重新定义PROM的值 下面的例子中把auto-boot? 变为 false,然后reset命令使系统重新启动,使变化生效 ok printenv auto-boot? auto-boot?true true ok ok setenv auto-boot? false auto-boot? = false ok reset 重置缺省值 使用set-defaults 命令将所有的参数重新设立为缺省的值 ok set-defaults ______________________________________________________________________ 注意 –set-defaults命令只对有缺省值的参数生效 ______________________________________________________________________ 影响系统启动和自检的按键有: stop 假如在系统加电自检时按下Stop键,就取消POST(加电自检)诊断,然后停留在OK状态。

    Stop+d 在系统自检时同时按下stop和d键,系统将自动转到诊断模式,诊断模式下系统将更完全地进行自检 Stop+n 假如由于NVRAM的设立不对的而导致系统无法对的启动时,可以在系统加电自检时同时按下stop和n键它的作用是将NVRAM的参数值设为默认值 Stop+a 同时按下stop和a键将中断操作系统的运营,退到OK状态 警告:尽量不要在操作系统运营时按stop+a,这将导致操作系统停止并且导致数据的丢失在万不得以的时候,在按下stop+a后,键入sync命令用以将内存的数据同步到硬盘中 l 探测系统总线 将外围设备(如光驱、硬盘)与主板连接在一起的I/O总线有SCSI(small computer system interface)总线和IDE (integrated drive electronics)总线 在OpenBoot 3.x系统中使用probe-命令 在OpenBoot 3.x的系统中,使用probe-命令时,您会看到一个警告假如您在操作系统运营状态下,用stop-a将系统强行暂停,或使用halt退出操作系统这样的状态下使用probe-命令会导致机器挂起。

    因此,您必须先运营reset-all命令 请先设立auto-boot?为false后再运营reset-all,系统将重新自检,停留在OK状态下,然后可以运营这个命令 显示连接在SCSI总线上的设备 probe-scsi命令将鉴别连接在SCSI控制器上的设备 ok probe-scsi Target 3 Unit 0 Disk SEAGATE ST1480 SUN0016 Copyright (c) All Rights Reserved Target 6 Unit 0 Removable Read Only device SONY CD-ROM ok probe-scsi-all 显示连接在PCI总线上的IDE设备 ok probe-ide Device 0 ( Primary Master ) ATA Model : ST 34342A Device 1 ( Primary Slave ) Not Present Device 2 ( Secondary Master ) removable ATAPI Model : CDR-8240B Device 3 ( Secondary Slave ) Removable ATAPI Model yyyyyyyyyyyyyyy 可以使用devalias命令查看设备别名的物理地址,这样就可以知道启动设备的物理设备了。

    ok devalias screen /SUNW,ffb@1e,0 mydisk /pci@1f,0/pci@1,1/ide@3/disk@0,0 net /pci@1f,0/pci@1,1/network@1,1 cdrom /pci@1f,0/pci@1,1/ide@3/cdrom@2,0:f disk /pci@1f,0/pci@1,1/ide@3/disk@0,0 disk3 /pci@1f,0/pci@1,1/ide@3/disk@3,0 disk2 /pci@1f,0/pci@1,1/ide@3/disk@2,0 disk1 /pci@1f,0/pci@1,1/ide@3/disk@1,0 disk0 /pci@1f,0/pci@1,1/ide@3/disk@0,0 ide /pci@1f,0/pci@1,1/ide@3 floppy /pci@1f,0/pci@1,1/ebus@1/fdthree ttyb /pci@1f,0/pci@1,1/ebus@1/se:a ttya /pci@1f,0/pci@1,1/ebus@1/se:b keyboard! /pci@1f,0/pci@1,1/ebus@1/su@14,3083f8 keyboard /pci@1f,0/pci@1,1/ebus@1/su@14,3083f8 mouse /pci@1f,0/pci@1,1/ebus@1/su@14,3062f8 设备别名在左列。

    设备物理地址在右列 假如操作系统挂起了(没有响应),并且您也不能远程登录,那您没有别的选择了,只有强行中断操作系统 l 中断挂起的系统 假如系统挂起了,可以尝试下列环节: 1.用Stop-a中断操作系统假如成功,系统会停留在PROM状态假如是使用字符终端作为系统控制台,则按Break键 2. 用sync命令将内存的内容同步到磁盘,减少数据的丢失结束后系统会自动重起 在ok提醒符下键入sync命令 ok sync 注意 – 您也可以用Stop-a强行中断操作系统,然后键入go恢复操作系统运营不建议使用此功能第三章 安装Solaris操作系统Software Groupings 基本 包含系统运营所需的最基本的软件和设备驱动不涉及图形界面和手册页 最终用户 除了基本软件外,还涉及图形界面 开发者 涉及编译工具、图形界面、手册页 完整分发和 OEM 支持 包含所有内容和一些OEM地硬件设备驱动 Installation Information Worksheet Acquire the following necessary information prior to your installation: Host name:____________________________________________________ IP address:_____________________________________________________ Name service (NIS, NIS+, DNS or None):_________________________ Subnet (yes or no):______________________________________________ Geographic location:____________________________________________ Time zone information:__________________________________________ Root password:_________________________________________________ Installation Process 1. Insert the CD-ROM into the CD-ROM drive. 2. Boot the release media. ok boot cdrom 3. Select the appropriate language and locale for your site and click on Continue. 4. Enter the assigned host name for the system 5. Type the IP address 6 . Select the type of the name service 7. Select Time Zone 8. Select Initial to perform an initial install and not preserve current settings 9 . Select the software group 10 . Set the sizes of each disk partition 11 . Type a root (superuser) password 第四章 软件包管理 所有Solaris系统的软件都以包的形式出现。

    软件包包含: 软件包的描述文献 系统需求的描述文献 需要安装的文献 安装前以及安装后需要运营的脚本 1. The pkgadd command 用于安装软件包 pkgadd [ -d [device | pathname ]] pkg_name # pkgadd -d /cdrom/cdrom0/s0/Solaris_2.7/Product SUNWaudio Processing package instance from Audio applications (sparc) 3.6.4,REV=1.98.08.13 Copyright 1998 Sun Microsystems, Inc. All rights reserved. Using as the package base directory. ## Processing package information. ## Processing system information. 2 package pathnames are already properly installed. ## Verifying package dependencies. ## Verifying disk space requirements. ## Checking for conflicts with packages already installed. ## Checking for setuid/setgid programs. This package contains scripts which will be executed with super-user permission during the process of installing this package. Do you want to continue with the installation of [y,n,?] y Installing Audio applications as ## Installing part 1 of 1. Installation of was successful. 2. The pkginfo command 不加任何参数用于查看系统已经安装的软件包 # pkginfo | more application SUNWAxg Solaris XGL 3.3 AnswerBook application SUNWaadm Solaris 7 System Administrator Collection system SUNWab2m Solaris Documentation Server Lookup system SUNWab2r Solaris Documentation Server system SUNWab2s Solaris Documentation Server system SUNWab2u Solaris Documentation Server application SUNWabda Sun Ultra 5/10 Hardware AnswerBook application SUNWabe Solaris 7 User Collection application SUNWabsdk Solaris 7 Software Developer Collection The pkginfo Command 后面可跟一些参数,显示特定某个软件包的信息 Command Format pkginfo [ -d [ device | pathname ] ] [ -l ] pkg_name 参数 -d device 指定软件所在的位置,可以是目录、磁带机、软盘等等 -l 显示具体信息 pkg_name 软件包名 输出列 CATEGORY 软件包的类型,是“应用软件”和是“系统软件” PKGINST 软件包名,假如是SUNW打头,则是SUN的产品 NAME 软件的简要描述 # pkginfo -d /cdrom/cdrom0/s0/Solaris_2.7/Product -l SUNWaudio PKGINST: SUNWaudio NAME: Audio applications CATEGORY: system ARCH: sparc VERSION: 3.6.4,REV=1.98.08.13 BASEDIR: / VENDOR: Sun Microsystems, Inc. DESC: Audio binaries PSTAMP: dtbuild37s753 HOTLINE: Please contact your local service provider STATUS: spooled FILES: 9 spooled pathnames 2 directories 3 executables 4 package information files 700 blocks used (approx) 3. The pkgrm Command Command Format pkgrm package_name 用于删除软件包 # pkgrm SUNWaudio The following package is currently installed: SUNWaudio Audio applications (sparc) 3.6.4,REV=1.98.08.13 Do you want to remove this package? y ## Removing installed package instance ## Verifying package dependencies. WARNING: The package depends on the package currently being removed. WARNING: The package depends on the package currently being removed. WARNING: The package depends on the package currently being removed. WARNING: The package depends on the package currently being removed. Dependency checking failed. Do you want to continue with the removal of this package [y,n,?,q] 假如某个文献被多个包共享,则当最后一个包被删除时才被删除。

    4. The pkgchk Command 用于检查已安装的软件包 Command Format pkgchk [ -p path1 [ path2...] ] # pkgchk SUNWaudio # # pkgchk -p /etc/group ERROR: /etc/group file size <278> expected <282> actual file cksum <23586> expected <24038> actual pkgchk命令校验包的属性和内容是否与系统记录的一致 这个命令能检测整个包或是某个文献没有输出表达包已经安装,但未发现不一致 5. admintool图形管理工具 admintool是solaris图形管理工具,涉及管理软件包、主机名、主机地址、打印机、串口、用户、用户组等 第五章 补丁维护l 什么是Patch? 简朴的说,补丁就是一些替换现存的文献和目录的文献目录集合补丁纠正应用程序的错误或增长功能 l Patch编号 每个补丁都有编号例如补丁号为101945,版本是34的话,这个补丁的目录名就是101945-34. l patchadd命令用于安装补丁: # cd /tmp # ls 105160-01 ps_data sdt_fl8zKOI_ # patchadd 105160-01 Checking installed packages and patches... Verifying sufficient filesystem capacity (dry run method) Installing patch packages... Patch number 105160-01 has been successfully installed. See /var/sadm/patch/105160-01/log for details Patch packages installed: SUNWdtbas l patchrm用于删除补丁 # patchrm 105633-06 Checking installed packages and patches... Patch 105633-06 has been backed out. # 下面的命令用于检查系统的补丁情况 # patchadd -p Patch: 105160-05 Obsoletes: Requires: Incompatibles:Packages: SUNWdtbas # showrev -p Patch: 105160-05 Obsoletes: Requires:Incompatibles: Packages: SUNWdtbas 第六章 启动过程l 启动有四个阶段 Boot PROM 阶段 Boot program 阶段 Kernel 初始化阶段 /sbin/init 阶段 启动过程: 自检、显示系统信息、读取启动设备的0扇区、在启动设备寻找启动程序、加载启动程序、启动内核、运营/sbin/init。

    /sbin/init程序 读取/etc/inittab文献Init程序执行/sbin/rc*脚本 l 系统有多种运营级别,不同的运营级别所启动的服务不同 系统运营级别有8种,分别为: 运营级别 意义 0 进入PROM状态(OK状态) 1 管理状态(所有文献系统都挂上的单用户模式,严禁其他用户登录) 2 多用户模式(没有网络文献共享服务) 3 多用户模式(有网络文献共享服务) 4 未使用 5 退出操作系统并关机 6 重新启动机器 S,s 单用户模式 who命令查看运营级别 # who -r . run-level 3 5月 10 17:03 3 0 S 可得到的信息:当前运营级别是3,系统启动的时间是5月10日17:03. /etc/inittabinittab定义了: 系统缺省运营级别 系统进入新运营级别需要做什么 /etc/init.d目录包含了系统的一些启动脚本 /etc/rc1.d目录包含进入运营级别1所需要运营的一些脚本 /etc/rc2.d目录包含进入运营级别2所需要运营的一些脚本 ... ... 这些目录下包含两种文献: 以K打头,后面跟两个数字以及一些字符串:表达系统到这个运营级别时所需要停止的一些服务,系统将以stop调用这个脚本。

    以S打头,后面跟两个数字以及一些字符串:表达系统到这个运营级别时所需要开始的一些服务,系统将以start调用这个脚本 增长启动控制脚本 1.Identify the run level for the service 2.Determine which services are needed by the new process 3.Change to /etc/rc#.d and identify startup script 4.Repeat the process for the directory containing the shutdown script 5.Create the startup (shutdown) script in /etc/init.d 6.Create hard links to appropriate /etc/rc#.d directories 7.test 改变运营级别 init命令用于改变操作系统的运营级别 命令格式: init [ 0123456Ss ] # init 0 INIT: New run level: 0 The system is coming down. Please wait. System services are now being stopped. Print services stopped. Stopping the syslog service. syslogd: going down on signal 15 Aug 14 14:54:30 snmpdx: received signal 15 The system is down. syncing file systems... done Program terminated Type help for more information ok shutdown 用于改变操作系统运营级别。

    命令格式: shutdown [ -y ] [ -g seconds ] [ -i init-state ] [message] 选项: y 系统提醒时默认回答为YES g 过多长时间改变 i 想要的运营级别 message 给所有登录用户的信息 # shutdown -y -g 0 -i 0 Shutdown started. Mon Dec 15 15:13:57 PST 1997 Broadcast Message from root (console) on mcmurdo Mon Dec 15 15:13:57... THE SYSTEM IS BEING SHUT DOWN NOW ! ! ! Log off now or risk your files being damaged Changing to init state 0 - please wait ok halt 进入0运营级别 poweroff 关闭系统并切断电源 reboot 重新启动系统 第七章 系统安全UIDs(用户ID) UIDs用于区别文献和目录的所有者。

    保存在 /etc/passwd GIDs(用户组ID) GIDs用户区别用户、文献、目录的组成员 l /etc/passwd文献记录了系统的用户帐号的信息 格式 loginID:x:UID:GID:comment:home directory:login shell #more /etc/passwd root:x:0:1:Super-User:/:/sbin/sh daemon:x:1:1::/: bin:x:2:2::/usr/bin: sys:x:3:3::/: adm:x:4:4:Admin:/var/adm: lp:x:71:8:Line Printer Admin:/usr/spool/lp: uucp:x:5:5:uucp Admin:/usr/lib/uucp: nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico listen:x:37:4:Network Admin:/usr/net/nls: nobody:x:60001:60001:Nobody:/: noaccess:x:60002:60002:No Access User:/: nobody4:x:65534:65534:SunOS 4.x Nobody:/: jxbcpp:x:901:410:Dave Lister:/export/home/jxbcpp:/bin/sh loginID 用户名 x 隐藏的口令。

    加密的口令放在/etc/shadow文献中 UID 用户ID GID 组ID comment 描述 home directory 个人主目录 login shell 登录后使用的shell l /etc/shadow文献记录了系统用户的加密后口令 格式 loginID:password:lastchg:min:max:warn:inactive:expire: #more /etc/shadow root:LXeokt/C/oXtw:6445:::::: daemon:NP:6445:::::: bin:NP:6445:::::: sys:NP:6445:::::: adm:NP:6445:::::: lp:NP:6445:::::: smtp:NP:6445:::::: uucp:NP:6445:::::: nuucp:NP:6445:::::: listen:*LK*::::::: nobody:NP:6445:::::: noaccess:NP:6445:::::: nobody4:NP:6445:::::: lister:ubQhZXEMv/lyI:10336:7:90:5:30:: loginID 相应用户名 password 加密后的口令。

    LK表达锁定帐号,NP表达无口令 lastchg 最后更改口令的日期与1970年1月1日之间相隔的天数 min 改变口令需要最少的天数 max 同一口令允许的最大天数 warn 口令到期时,提前告知用户的天数 inactive 用户不使用帐号多少天禁用帐号 expire 用户帐号过期的天数 最后一个字段未用 l /etc/group文献记录了系统的用户组的信息 格式 groupname:password:GID:userlist #more /etc/group root::0:root other::1: bin::2:root,bin,daemon sys::3:root,bin,sys,adm adm::4:root,adm,daemon uucp::5:root,uucp mail::6:root tty::7:root,tty,adm lp::8:root,lp,adm nuucp::9:root,nuucp staff::10: daemon::12:root,daemon sysadmin::14:lister,torey nobody::60001: noaccess::60002: Groupname 组名 password 口令。

    已经不使用 GID 组ID userlist 成员列表 一个用户可以同时属于多个组 id命令用于查看用户的id号(用户号) 命令格式 id [ options ] [ username ] $ id uid=10450(student1) gid=150(learning) $ id -a uid=10450(student1) gid=150(learning) groups=150(learning),14(sysadmin) 不加参数显示用户所在的id号用户和重要组id号 -a参数显示用户的所在所有组的组id号 改变用户 su命令用户改变当前的用户 $ su - jxbcpp Password: su命令后可以加-,也可以不跟假如跟-,则切换到那个用户后执行用户的启动脚本,如.profile 改变文献所有者 chown user_name filename # ls -l memo -rw-r--r-- 1 rimmer other 0 Jul 6 18:30 memo # chown chris memo # ls -l memo -rw-r--r-- 1 chris other 0 Jul 6 18:30 memo # cd /export/home # chown -R chris mydocs -R选项把mydocs目录下所有子目录及其文献的所有者都改变为chris。

    # chown -R lister:staff mydocs 把mydocs目录的所有者改为lister,所在组改为staff 注:只有管理员才干改变所有者 查看登录状态 命令who、finger、last可以查看用户登录状态 who 查看本机登录的用户状态显示用户名、登录的设备、登录时间以及登录的主机名字 $ who rimmer pts/1 Dec 21 07:07 (nepal) lister console Dec 21 12:18 (:0) 用户rimmer从机器nepal上登录而用户lister则在本地登录 finger 显示本地和远程系统用户的具体信息涉及用户名、用户注释信息、终端名、空闲时间、登录时间、登录主机名 $ finger bevw Login name: bevw In real life: bev’s account Directory: /home/bevw Shell: /bin/ksh Last login Wed Oct 21 08:07 on console from :0 No unread mail No Plan. last 显示系统的最近用户登录状况。

    $ last rimmer pts/4 pluto Fri Dec 18 10:24 - 11:00 (00:36) lister pts/4 pluto Tue Dec 8 09:39 - 09:49 (00:10) rimmer pts/4 pluto Thu Dec 3 15:16 - 15:17 (00:00) rimmer console :0 Wed Dec 2 08:47 still logged in reboot system boot Wed Dec 2 08:44 rimmer pts/0 pluto Tue Dec 1 17:27 - 17:28 (00:00) rimmer pts/3 pluto Tue Dec 1 16:13 - 16:39 (00:26) rimmer pts/2 pluto Tue Dec 1 15:32 - 15:38 (00:06) holly term/a pluto Tue Dec 1 15:12 - 08:41 (17:29) 第八章 用户管理可以用admintool图形工具增长、更改、删除用户和用户组。

    注意: 用户所在的组必须先于用户之前创建 l 命令行方式: 增长用户组 groupadd命令增长用户组 groupadd [-g gid] group 说明: g 制定组的ID号 gid 组的ID号(不能与现有的组ID号反复) group 组名 #groupadd –g 100 sun l useradd命令增长用户组 useradd [-u uid | -g group] | -d dir | -s shell | -c comment | -m [-k skel_dir] ] login 说明: u 指定用户ID号 g 制定所在组 d 指定用户目录 s 制定用户SHELL c 用户的注释 m 建立用户目录 login 用户的登录名 #useradd –u 1233 –g sun –d /export/home/sun –c “Sun test user.” –m –s /usr/bin/sh sun 第九章 初始化文献管理用户的初始化文献是一些命令脚本和shell参数 下表列出不同的shell所运营的初始化文献: Shell System User Template (Read First) (Read Second/Third) /etc/skel Bourne /etc/profile $HOME/.profile local.profile Korn /etc/profile $HOME/.profile local.profile C /etc/.login $HOME/.cshrc then $HOME/.login local.cshrc local.login 如当一个具有Bourne Shell的用户登陆系统后,系统将一方面自动运营/etc/profile这个初始化脚本,然后运营用户目录下的.profile初始化脚本。

    当创建一个Bourne Shell的用户时,系统会自动把/etc/skel/local.profile这个文献拷贝到用户主目录下因此/etc/skel下包含的是一些用户初始化脚本的模板 如何手工运营初始化脚本文献: Bourne and Korn Shells $ cd $ . ./.profile $ . ./.kshrc C Shell % source ~/.login % source ~/.cshrc 第十章 进程控制l 使用ps命令显示系统正在运营的进程 参数: e 列出系统所有的进程 f 列出具体清单 UID:运营进程的用户 PID:进程的ID PPID:父进程的ID C:进程的CPU使用情况(进程使用占CPU时间的比例) STIME:开始时间 TTY:运营此进程的终端或控制台 TIME:消耗CPU的时间总量 CMD:产生进程的命令名称 要查找某进程: #ps -ef|grep process_name l 使用Kill命令给进程发送一个信号Kill命令一般用于结束系统的某个进程 Solaris有44个信号每个信号有个数字和名称。

    假如你未制定信号,则默认为信号15,这个信号用于结束进程 用户只能结束自己启动的进程。

    点击阅读更多内容
    卖家[上传人]:枕上诗书
    资质:实名认证