HP UNIX系统管理笔记
Important Website
HPs product website www.hp 进入后选择大型企业-服务器-按系统分类或按处理器分类技术资料
HP’s IT Resource Center itrc.hp 可进入在线问答,英语(HP-UX);下载补丁
HP’s documentation website docs.hp
HP’s software download website software.hp
HP Education Services hp/education
Unix系统基础
Unix系统原理概述、SAM和SMH的介绍和使用
1、 Launching the SAM GUI登录进入图形化界面(use SAM/SMH) #echo SDISPLAN 开启虚拟终端
#sam & 打开SAM(5134课程3章CDE环境)并将进程切换至后台(14章)
如直接输入#SAM 在字符界面用键盘选择操作
2、V3版本中图形化系统管理
Step1: #smhstartconfig –a on –b off 修改配置,-a on表示开启atuostart url’s mode现用现调;
-b off表示关闭start on boot’ mode
Step2: #firefox sername.hp:2301/ 调用浏览器
或 #smhstartconfig –a off –b on
#firefox sername:2381 ――2381为加密端口,而2301为不加密端口
3、SMH可以自定义起始菜单,从tools里选取添加或卸载(在setting里add或remove) System Log Viewer: 查看过去登录的用户名last
查看过去登录但没成功的用户名last b
用户组管理(RBAC):存在Administrator, Operator, User等不同的用户对象,分别拥有不同权限。
4、SMH and SIM Integration Possibilities 集成化管理软件,SIM用WEB方式进行管理。
User and Group Contet: 每个用户至少要属于一个组,每个用户有且只有一个主要的组(主组);可以有多个属组及附属组。
5、
创建和管理用户账户、文件系统高级原理
1、用户账户
What defines a user Account (with三个重要文件):
1) PSWD:在/etc/passwd中,记录用户信息
1 2 3 4 5 6 7
Root: qmA8s.,8a3e: 0: 3: : /: /sbin/sh分配给系统自动调用的
User1: adok60AazRgXU: 1001: 1001: 111-1111: /home/user1: /usr/bin/sh
Username:Password: UID GID Comments Home Director Shell
用户ID 组ID 注释 登录主目录 用户登录后的第一个执行程序 **ROOT的UID为0(0-100都是由系统自动分配的,管理员只能从101开始分配)
**Use /usr/sbin/wipw to edit /etc /passwd
**Use /usr/sbin/pwck to check the /etc/passwd file syntax核对语法,但是重复的UID查不出来
2) /etc/shadow (optional可选的:strongly recommended to enable) r-----------只读
User1: AdOK60XU: 12269: 70: 140: 70: 35: :
Encrypted Password Last Changed min days max day warn day Inactive day unused
最后一次更改时间,距1970-1-1有多少天
Install the shadowPassword product (only necessary in 11i.V1)
Use /usr/sbin/pwck to verify your current /etc/passwd file syntax 核实语法
Use /usr/sbin/pwconv to move passwords from /etc/passwd to /etc/shadow 更改至shadow
Use /usr/sbin/pwunconv to move passwords back to /etc/password 回改至etc的passwd
3) /etc/group 默认只记录附属组
Other: : 1: root,daemon,uucp,sync
Group GID Members
Use /usr/bin/vi to edit /etc/group
Use /usr/sbin/grpck to check the /etc/group file syntax
2、 添加用户
Step1:
#useradd -o \ #allow a duplicate UID(不推荐,允许重复UID)
-u 101\ #define the UID(不推荐,定义用户ID为101)
-g users \ #define the primary groupdpph法
-G class,training \ #define secondary groups
-c “student user” \ #define the comment field(添加注释信息)
-m –d /home/user1 \ #make a home directory for the user(自动添加登录主目录)
-d /home/user1 \表示自己指定主目录,可不用
User
-s /usr/bin/sh #define the default shell(定义)
-e 1/2/09 \ #define an account expiration date(设置账号的生存日期)
-p fnnmD.DGyptLU #specify an encrypted password(写在一个文件中)花儿与少年百科
-t /etc/default/useradd #define the username(把一定的信息写进useradd模板,直接调用)
User1;
#passwd user1 #interactively specify a password or ```
#passwd –d user1 #set a null password(不推荐)
#passwd –f user1 #force a password change at first login(强制首次登录改口令)
口令设置三原则:用户口令不少于6位,至少包含2个英文字符,至少包含1个非英文字符
(注意:password不加用户名是修改系统管理员的口令)
实例:添加用户test01、test02
Useradd –m –s /usr/bin/sh test01
Passwd test01回车后输入口令
Useradd –g abc –G users –m –s /usr/bin/sh test02 设置用户的主组与附属组
3、 更改用户信息sir模型
#usermod –l user01 user1 #change the user’s username
#usermod –o –u –g –G –c –m –d –s –e –p
#passwd user1更改用户密码
4、阻止用户登录
1)#passwd –l user deactivate a user account锁定用户口令,用户永远不能再登录
#passwd user1 reactivate a user account解锁
轻水反应堆2)#rm –rf /home/user1 删除用户登录主目录
3)#find / -user user1 –type f –exec rm –i + 把所有属于user1(-user user1)的普通文件(–type f)通篇搜出(find /)执行(–exec +)删除(rm –i)
#find / -user user1 –type d –exec rmdir + 把目录通篇删除
4)#find / -user user1 –exec chown user2 + 把属于user1的文件全给user2
5、删除用户
小型变速箱#userdel user1 Delete a user account but leave the user’s file untouched灵魂之语
#userdel –r user1 Delete a user account and remove the user’s home directory
#find / -user user1 ……..
#find / -nouser –exec ll –d + Find 无组无用户的文件 ll为ls –l全部列出list