rpmdb-redhat记录rpm相依性套件
system-config-packages
automaticdependencyresolution
如何自动安装相依性的套件
1.要使用rpmdb-redhat这个软件的资料库
2.所有相依性的rpm必须放在同一个目录
3.加上--aid参数
如:
rpm–ivh***.rpm--aid
redhatnetwork(RHN)
提供redhate-paper
警告我们哪些套件需要更新
redhatupdateagent
usingkickstarttoautomateinstalltion使用kickstart自动安装redhatlinux
使用kickstart自动安装,需要安装此套件
kickstart%packages
要安装的套件
kickstart%pre%post
安装之前和之后要执行的scripts
networkinstallationserver
必须通过网络,可以通过NFS,FTP,HTTP的方式。
必须将redhat的安装光盘全部拷贝到服务器上。
架设好网络安装服务器后,把第一张光盘插入客户端启动,把ks.cfg拷贝到软盘
启动后输入linuxks=floppy
useradministration
userpolicyconsiderations
有多少人会使用,是不是要限制事件或地点
密码多久要更改一次
是否限制CPU和memory
是否限制硬盘空间
theuseraccountdatabase-/etc/passwd
档案里存储了系统账户资料,每个用户占用一行
less/etc/passwd
按v进入编辑模式
chfn更改用户finger
这个文件权限rw-r--r--
passwd的用户名后面的x去掉后次用户登录就不需要密码了
shell是/sbin/nologin,那么此用户不能登录系统但是可以登录本机的ftp
shell是/bin/false,那么此用户仅可以收发邮件。
addinganewuseraccount
useraddusername
系统实际上去编辑
/etc/passwd,/etc/shadow,/etc/group
createandpopulatehomedirectory
setpermissionandownership
setaccountpasswordusingpasswd
/etc/skel默认的用户/home文件,文件几乎一样,不同的是ownership不一样
使用newusers建立大量用户,编辑aaa,依照passwd格式填写
viaaa
user4user4:
503:
503:
:
/home/user4:
/bin/bash
user5user5:
504:
504:
:
/home/user4:
/bin/bash
newusersaaa
使用newusers建立用户的时候只会建立home目录而不会复制skel的内容
userprivategroups(UPG)
在建立账户的同时,为这个账户建立一个同名的私有组,并把这个帐号加入到这个私有组来.所有以此账户建立的文件的组权限都会有这个私有组.防止此账户新增的档案不属于任何一个群组。
groupadministration
entriesaddedto/etc/group
groupadd
groupmod
groupdel
modifying/deletingaccounts
修改用户资料
修改/etc/passwd
使用命令usermod
更改用户home
mkdir/home/test-6
chowntest6:
test6/home/test-6
usermod-d/home/test-6test6
后面跟新的家目录
usermod-Ggroup1test6把用户加入到其他群组
usermod-ggroup2test6更改用户主要群组
usermod–Ltest6锁定test6账户,实际上是更改/etc/shadow密码字段前加!
如果是!
!
表示这个用户还未设置密码
usermod–Utest6解除锁定
删除用户
手动方式编辑/etc/passwd,/etc/shadow,/etc/group,/var/spool/mail/username
命令方式userdel-rtest6,使用userdel命令不会删除/etc/group里test6组的内容,可以使用groupdeltest6
passwordagingpolicies
默认情况下,密码永远不会过期
为安全考虑,可以强制多长时间修改一次密码
更改/etc/login.defs设置默认用户密码有效期
也可以使用chage[option]user变更密码时间相关参数
chage-luser6查看账户密码信息
chage-I3user6密码过期几天后锁定用户帐户,默认是-1。
loginshellscripts
/etc/profile
/etc/profile.d/*.sh
~/.bash_profile
~/.bashrc
/etc/bashrc
nonloginshellscripts
~/.bashrc
/etc/bashrc
/etc/profile.d/*.sh
profile
bashrc
purpose
settingvariablevalue
configurebash
forallusers
/etc/profile
/etc/bashrc
foroneuser
~/.bash_porfile
~/.bashrc
characteristic
sourceisloadedonlyat
login
newsettingswilltakeeffectatthenextlogin
sourceisloadedatandloginsubshell
不论登录还是开启子shell都会执行
switchingaccount
syntax
su[-][user]
su[-][user]-ccommand如果只要以某个用户身份执行某个命令
允许暂时切换成别的账户工作,默认情况下,不指定是root
su
su-
[-]是切换到新的用户,并开启一个loginshell,如果不加-,只是切换到新用户,开启一个nologinshell
sudo
让一般的用户可以执行只有root才可以执行的指令
可以在/etc/sudoers文件里定义某一个特定的账户可以执行某一个特定的只有root可以执行的指令
aneffectiveuseridof0
groupidofroot’sgroup
/etc/sudoers没有定义的账户使用sudo时,会通知root
visudoers只读方式
visudosudoers编辑
networkusers
我们可以把用户资料集中存储在网络上一台服务器上,资料包括:
UID,defaultshell,homedirectory,groupmemberships,andsoon,可以是NIS或LDAP服务器
vi/etc/nsswitch.conf
paaswd
shadow
group
authenticationconfiguration
system-config-authenticationGUI界面
如果在命令后加--nox会开启文字界面
authconfig命令直接使用文字界面
支持一下几种认证服务器:
(localfiles),NIS,LDAP,Hesiod,Winbind
支持认证方式:
(NSS),Kerberos,LDAP,SMB,winbind(MSAD)
NISconfiguration(配置NIS服务器验证用户身份)
MustinstallypbindandypserverandportmapRPMs
runsystem-config-authentication
enableNIStoprovideuserinformation
specifyNISserverandNISdomainname
keepdefaultauthentication
whatdoesthisactuallydo?
fourtext-basedconfigurationfilesarechanged
/etc/sysconfig/networkNISDOMAIN
/etc/yp.confNISserverforNISdomain
/etc/nsswitch.confuseNIS
/etc/pam.d/system-authshadowNIS
LDAPconfiguration
Mustinstallnss-ldapandopenldapRPMs
Runsystem-config-authentication
enableldaptoprovideuserinformation
specifyserver,thesearchbaseDNandTLS
enableLDAPtoprovideauthentication
Thepurposeforusingauthenticationtool
fourtext-basedconfigurationfilesarechanged
/etc/ldap.conf
/etc/openldap/ldap.conf
/etc/nsswitch.conf
/etc/pam.d/system-auth
fileownership
everyfilehasbothuserandgroup“ownership”
anewlycreatefilewillbeownedby:
theuserwhocreateit
thecurrentprimarygroupofthatuser
sgiddirectoriesmaychangethisbehavior
thechowncommandcanbeusedbyroottochangeownership
linuxfilepermission
accesslevels
uuser
ggroup
oother
accessmodes
wwrite
rread
xexecute
flagsindicateaccessmodeforeachaccesslevel
filemodsisaconcisecollectiveofflags’valuesexpression
ddirectory
-file
sudi/sgidexecutables
file
directory
command
filemode
SUID
Runswiththe
permissionof
itsowner
N/A
chmodu+s
chmod4755
s=x+suid
S=-+suid
SGID
Runswiththe
permissionof
itsgroup
fileswillinherit
itsgroupaffiliation
fromthedirectory
chmodg+s
chmod2771
s=x+SGID
S=-+SGID
sticky
N/A
Filescouldbedeletedonlybyitsownerorroot
chmod=o+t
chmod=1777
t=x+sticky
T=-+sticky
默认情况下,用户执行一个可执行文件的时候会以自己的身份执行,但是设置了SUID或SGID的时候,用户分别会以用户所有者身份和所属组身份执行
thestickybit
如果使用者在一个目录上有write权限的话,那么不论在文件上有哪些权限,也不管文件的所有者是谁,使用者都可以删除掉目录里的档案,但是如果在目上设定了sticky权限后,那么在这个目录里的档案只有档案的所有者可以删除自己的档案.
thesetgidaccessmode
默认情况下,使用者在目录里建立的档案会属于预设的群组,但是如果在这个目录上设置了SGID权限的话,那么,使用者在这个目录里建立的档案都会属于这个目录所属的群组
defaultfilepermission
当我们建立文件或目录是,系统会把所有权限放开给所有人,但是还要经过umask的计算
non-systemuser’sumask002
fileswillhavepermissionof664
directorieswillhavepermissionmof775
supportuserprivategroups
systemuser’sumask022
/etc/bashrc里定义了umask
有个判断的语句,判断用户与所属组是否一致,一致为022,不一致022
accesscontrollists(ACLs)
GrantRWXaccesstofilestomultipleusersorgroups
ACLs可以针对某些特定的使用者或者是组来设定对某一个特定文件或一个特定目录的权限
vifstab
LABEL=//ext3default,acl00
getfacl/opt查看目录的acl设置
setfacl设定acl
setfacl-mu:
user1:
r-x/project1
在project1目录上为user1开放r和x权限
printingandadministrationtools
CUPSOverview
commonunixprintingsystem
支持*.html*.pdf*.jpg…等格式
CUPSconfigurationfiles
/etc/cups/cupsd.conf
/etc/cups/printers.conf
lpadmin
system-config-printer
cupsweb界面形式
CUPSqueuemanagement
system-config-printer
system-config-printer-tui
http:
//localhost:
631
cron
可以让系统在指定的时间去做某个工作
mancrontab
man5crontab
蓝色是一组,红色是一组,中间是or的关系
Minute
Hour
Dayofmonth
Month
Dayofweek
Meaning
0
0
25
12
*
Runonceayear
0
*
*
*
*
Ruanonceanhour
*/10
*
*
*
*
Runonceevry10minute
13
13
13
*
5
Runonceevery13that13:
13,andeveryFriday
2
4
*
*
*
Runonceaday
日期和星期之间是or连接的
crontab的任务是在背景中执行的,比如echo命令也是不会显示在终端上的,执行完毕后会发一封邮件给root
controllingaccesstocron
/etc/cron.allow
/etc/cron.deny
限制哪些人可以使用cron
systemcrontabfiles
/etc/crontab
系统里的crontab文件,系统所使用的crontab存在以上这个文件里。
024***rootrun-parts/etc/cron.hourly
使用root身份执行/etc/cron.hourly目录下所有的脚本
/etc/cron.hourly
/etc/cron.daily
/etc/cron.weekly
/etc/cron.monthly
systemcronjob:
tmpwatch
/etc/cron.daily/tmpwatch
系统每天都会执行这个scripts
mantmpwatch清除系统很长时间没有存取的档案
默认情况下tmpwatch会判断文件的atime,查看是否要清除这个文件。
systemcronjob:
logrotate
/etc/cron.daily/logrotate压缩并邮寄系统的log文件
可以通过/etc/logrotate.conf来设定logrotate
默认情况下每周压缩备份系统log,保存在/var/log/messages
systemlogging
系统里有2个服务负责系统日志的记录,
syslogd负责记录应用过程序产生的log,
klogd负责记录kernel产生的log
sys