当前位置: 首页 > news >正文 婚庆网站建设策划案费用预算国家企业公司网 news 2025/11/4 14:40:46 婚庆网站建设策划案费用预算,国家企业公司网,wordpress有繁体,网络服务器管理软件权限管理 文件的权限针对三类对象进行定义#xff1a; owner属主#xff0c;缩写ugroup属组#xff0c;缩写gother其他#xff0c;缩写o 1、文件的一般权限 #xff08;1#xff09;r,w,x的作用及含义#xff1a; 权限对文件影响对目录影响r#xff08;read#xf…权限管理 文件的权限针对三类对象进行定义 owner属主缩写ugroup属组缩写gother其他缩写o 1、文件的一般权限 1r,w,x的作用及含义 权限对文件影响对目录影响rread读可以读取文件内容 可以列出目录的内容即目录下的文件的文件名 wwrite写 可以更改文 件的内容 可以创建或者删除目录中的任一文件只有w权限无法创建删除文件需要和x权限一起使用 xexecute执行 可作为可执行文件 可以切换到目录 -无没有权限PSroot账户不受文件权限的读写限制执行权限受限制 2相应二进制可表示对应权限 所属者/所属组/其他用户权限的字符表示 二进制表示 八进制表示 ---0000--x0011-w-0102-wx0113r--1004r-x1015rw-1106rwx1117 如图 3常见普通权限组合 目录r-xrwx---文件文本文件r-xrw-rwxr----- 2、修改权限 1修改文件或目录的权限 --- chmod 格式1chmod [选项] [ugoa][-][rwx] 文件或目录..格式2chmod [选项] nnn 文件或目录... 常用选项u g o a 权限设置所针对的用户类别。 u(user)表示文件或目录的属主(所有者)g(group)表示属组内的用户o(others)表示其他用户a(all)表示所有用户(即ugo) 或 - 或 设置权限的操作动作代表添加某个权限-代表取消某个权限表示只赋予给定的权限并取消原有的权限 rwx 用字符形式表示的所设置的权限可以是其中一个字母或组合 nnn 用三位八进制数字表示的权限 例1修改文件a1的权限 [roottianqinwei test]# ll --- 查看文件权限 total 0 -rw-r--r--. 1 root root 0 Mar 6 17:45 a1 [roottianqinwei test]# chmod o-r a1 --- 对其他用户去掉可读权限 [roottianqinwei test]# ll a1 -rw-r-----. 1 root root 0 Mar 6 17:45 a1 [roottianqinwei test]# chmod g--- a1 --- 将所属组权限改为--- [roottianqinwei test]# ll a1 -rw-------. 1 root root 0 Mar 6 17:45 a1 [roottianqinwei test]# chmod 640 a1 --- 用数字来修改权限参考上方二进制转为八进制 [roottianqinwei test]# ll a1 -rw-r-----. 1 root root 0 Mar 6 17:45 a1 [studenttianqinwei test]$ cat a1 --- 验证普通用户对a1没有权限 cat: a1: Permission denied [roottianqinwei ~]# ll -d /root/ drwxrwxrwx. 16 root root 4096 Mar 6 18:18 /root/ [roottianqinwei test]# chmod a-w /root/ --- 将/root/用户所属组其他用户的写权限全都修改 [roottianqinwei test]# ll -d /root/ dr-xr-xr-x. 16 root root 4096 Mar 6 18:18 /root/ 例2将文件a2改为所属组和其他用户可读可写 [roottianqinwei test]# chmod grw-,orw- a2 --- 中间部分命令用逗号隔开系统会把o部分认为是文件名称所以用空格分隔会报错 [roottianqinwei test]# ll a2 -rw-rw-rw-. 1 root root 0 Mar 6 17:45 a2 [studenttianqinwei test]$ cat a2 --- 验证可对文件进行可读操作 azsdfgarhae5rhjndtgnsrt6jnjmrfsngxer5dyhusrtn 2修改文件或目录的属主和属组 1 chown可同时修改属主和属组 格式chown [选项] 新属主[:[新属组]] 文件或目录… 例修改文件a2所属主所属组 [roottianqinwei test]# ll a2 -rw-rw-rw-. 1 root root 46 Mar 6 18:05 a2 [roottianqinwei test]# chown student a2 --- 修改所属主 [roottianqinwei test]# ll a2 -rw-rw-rw-. 1 student root 46 Mar 6 18:05 a2 [roottianqinwei test]# chown :student a2 --- 修改所属组 [roottianqinwei test]# ll a2 -rw-rw-rw-. 1 student student 46 Mar 6 18:05 a2 [roottianqinwei test]# chown root:root a2 --- 同时修改所属主和所属组 [roottianqinwei test]# ll a2 -rw-rw-rw-. 1 root root 46 Mar 6 18:05 a2 2 chgrp只能修改文件的所属组 格式chgrp [选项] [新属组] 文件或目录... 例修改文件a3所属组 [roottianqinwei test]# ll a3 -rw-r--r--. 1 root root 39 Mar 6 18:05 a3 [roottianqinwei test]# chgrp student a3 [roottianqinwei test]# ll a3 -rw-r--r--. 1 root student 39 Mar 6 18:05 a3 3例student用户可读可写a3其他用户都不可进行操作 [roottianqinwei test]# ll a3 --- 查看a3文件的权限以及所属主和组 -rw-r--r--. 1 root student 39 Mar 6 18:05 a3 [roottianqinwei test]# chmod 600 a3 --- 将文件所属组和其他用户的所有权限取消 [roottianqinwei test]# ll a3 -rw-------. 1 root student 39 Mar 6 18:05 a3 [roottianqinwei test]# chown student:root a3 --- 将文件的所属主改为student所属组改为root [roottianqinwei test]# ll a3 -rw-------. 1 student root 39 Mar 6 18:05 a3 则此时文件仅可由student用户进行读写 3、文件的特殊权限 1SUIDus权限 1 含义为了让一般用户在执行某些程序的时候 在程序的运行期间 暂时获得该程序文件所属者的权限 如 [roottianqinwei test]# ll /usr/bin/passwd --- 当用户使用passwd命令的时候短暂拥有该命令所有者root的权限 所以此时普通用户就可在shadow上进行操作修改且只能在二进制执行文件上使用 -rwsr-xr-x. 1 root root 34512 Aug 13 2018 /usr/bin/passwd [roottianqinwei test]# ll /etc/shadow ----------. 1 root root 1309 Oct 21 08:51 /etc/shadow student 用户在执行 passwd 修改自己的密码时 其修改的密码 最终是需要保存到 /etc/shadow 这个文件中而这个文件的权限是 --------- 它的拥有者是 root 也只有root 可以“ 强制” 存储 其他用户连看都不行。可student 去执行 passwd /usr/bin/passwd) 却可以更新自己的密码 2 例将文件a1和a2得到权限修改为SUIDus [roottianqinwei test]# ll total 12 -rwxrwxrwx. 1 root root 241 Mar 6 18:05 a1 -rw-rw-rw-. 1 root root 46 Mar 6 18:05 a2 [roottianqinwei test]# chmod us a1 --- 将用户权限修改为us [roottianqinwei test]# chmod us a2 [roottianqinwei test]# ll total 12 -rwsrwxrwx. 1 root root 241 Mar 6 18:05 a1 --- 若该文件是可执行文件显示为s -rwSrw-rw-. 1 root root 46 Mar 6 18:05 a2 --- 若改文件是不可执行文件显示为S 有 s 权限的存在当 s权限在拥有者的权限位上时 即如 -rwsr-xr-x 这样时 称为SUID 。SUID 即 Set UID UID 指的是拥有者的的 ID 而这个程序 (/usr/bin/passwd) 的拥有者为root) PS SUID仅对二进制文件有效执行过程中调用者暂时获得该文件所有者权限该权限只在执行过程中有效 2SGIDgs权限 1 作用 文件如果 SGID 设置在二进制文件上则不论用户是谁在执行该程序时程序所属组将会变成该程序文件的所属组目录若SGID设置在A目录上则A目录内所建立的文件和目录的所属组将会是A目录的所属组 2 例将用户haha放入student组中在该组中将权限更改为SGID使得haha用户也可创建或删除文件 [roottianqinwei test]# useradd haha --- 添加用户haha [roottianqinwei test]# gpasswd -a haha student --- 添加用户haha到student组中 Adding user haha to group student [roottianqinwei test]# tail -2 /etc/group student:x:1000:haha haha:x:1001: [roottianqinwei test]# ll -d /test drwxr-xr-x. 2 root root 36 Mar 6 18:05 /test [roottianqinwei test]# chown :student /test --- 将目录/test所属组改为student [roottianqinwei test]# ll -d /test drwxr-xr-x. 2 root student 36 Mar 6 18:05 /test [roottianqinwei test]# chmod gs /test --- gs的效果只要在所属组中的用户都可在该目录下创建或删除文件操作的文件都在student这个组中 [roottianqinwei test]# chmod gw /test --- 给所属组添加可写权限 [roottianqinwei test]# ll -d /test drwxrwsr-x. 2 root student 36 Mar 6 18:05 /test 验证 [studenttianqinwei test]$ touch ss [hahatianqinwei test]$ touch dd [roottianqinwei test]# ll -rw-rw-r--. 1 haha student 0 Mar 6 20:07 dd --- haha用户创建出的文件所属主为haha所属组为student -rw-rw-r--. 1 student student 0 Mar 6 20:07 ss --- student用户创建出的文件所属主为student,所属组为student 3Sticky Bit--SBitot只针对目录有效 对文件没有效果 1 含义具有 SBit 的目录下 用户若在该目录下具有 w 及 x 权限 则当用户在该目录下建立文件或目录时 只有文件拥有者与 root 才有权力删除 2 例将目录 /test 其他用户的权限更改为SBit [roottianqinwei test]# ll -d /test drwxrwsrwx. 2 root student 56 Mar 6 20:07 /test [roottianqinwei test]# chmod ot /test [roottianqinwei test]# ll -d /test drwxrwsrwt. 2 root student 56 Mar 6 20:07 /test --- o用户在该目录下只可针对自己创建的文件进行“删除/重命名/移动”操作4、ACL权限 1含义若想指定一个用户想访问一个组中的文件而该组中无此用户则可用ACL权限指定该用户赋予其相应权限。 2命令 1 查看权限getfacl [文件名] 2 设定权限setfacl 选项 文件名 常用选项-m 设定 ACL 权限。如果是给予用户 ACL 权限则使用 u:用户名:权限 格式赋予如果是给予组 ACL 权限则使用 g:组名:权限 格式赋予 -x 删除指定的ACL权限-b删除所有的ACL权限-d设定默认ACL权限。只对目录生效目录中新建立的文件有此默认权限-k删除默认ACL权限-R递归设定ACL权限。指设定的ACL权限会对子目录下所有文件生效 例文件权限为rwx rw- ---文件所属主为wu文件所属组为csa。若让组外用户xixi对此目录中文件可读可写且不让其他用户拥有权限命令为setfacl -m u:xixi:rw- cs 5、umask权限掩码 1作用设置新建文件或目录的默认权限 2默认umask 在Linux系统中当用户创建一个新的文件或目录时系统都会为新建的文件或目录分配默认的权限该默认权限与umask值有关其具体关系是 新建文件的默认权限0666-umask值新建目录的默认权限0777-umask值[roottianqinwei test]# umask --- 查看默认umask值 00223例umask默认值为033则对应的文件和目录的默认权限是什么 则文件对应默认权限是644目录对应默认权限为744 文章转载自: http://www.morning.rmpfh.cn.gov.cn.rmpfh.cn http://www.morning.zzfjh.cn.gov.cn.zzfjh.cn http://www.morning.nfdty.cn.gov.cn.nfdty.cn http://www.morning.hhzdj.cn.gov.cn.hhzdj.cn http://www.morning.syqtt.cn.gov.cn.syqtt.cn http://www.morning.bgpb.cn.gov.cn.bgpb.cn http://www.morning.dydqh.cn.gov.cn.dydqh.cn http://www.morning.bklkt.cn.gov.cn.bklkt.cn http://www.morning.kjcfz.cn.gov.cn.kjcfz.cn http://www.morning.wtcyz.cn.gov.cn.wtcyz.cn http://www.morning.jyjqh.cn.gov.cn.jyjqh.cn http://www.morning.lrplh.cn.gov.cn.lrplh.cn http://www.morning.mpngp.cn.gov.cn.mpngp.cn http://www.morning.sgnjg.cn.gov.cn.sgnjg.cn http://www.morning.dljujia.com.gov.cn.dljujia.com http://www.morning.hjlwt.cn.gov.cn.hjlwt.cn http://www.morning.kphyl.cn.gov.cn.kphyl.cn http://www.morning.jpqmq.cn.gov.cn.jpqmq.cn http://www.morning.ychoise.com.gov.cn.ychoise.com http://www.morning.qsy39.cn.gov.cn.qsy39.cn http://www.morning.wphzr.cn.gov.cn.wphzr.cn http://www.morning.qyjqj.cn.gov.cn.qyjqj.cn http://www.morning.hdrsr.cn.gov.cn.hdrsr.cn http://www.morning.ntkpc.cn.gov.cn.ntkpc.cn http://www.morning.fesiy.com.gov.cn.fesiy.com http://www.morning.rrqbm.cn.gov.cn.rrqbm.cn http://www.morning.zhmgcreativeeducation.cn.gov.cn.zhmgcreativeeducation.cn http://www.morning.rdxp.cn.gov.cn.rdxp.cn http://www.morning.jjzxn.cn.gov.cn.jjzxn.cn http://www.morning.ssfq.cn.gov.cn.ssfq.cn http://www.morning.mfsjn.cn.gov.cn.mfsjn.cn http://www.morning.yfffg.cn.gov.cn.yfffg.cn http://www.morning.bzfwn.cn.gov.cn.bzfwn.cn http://www.morning.hqsnt.cn.gov.cn.hqsnt.cn http://www.morning.qxwrd.cn.gov.cn.qxwrd.cn http://www.morning.txmkx.cn.gov.cn.txmkx.cn http://www.morning.cykqg.cn.gov.cn.cykqg.cn http://www.morning.gbfck.cn.gov.cn.gbfck.cn http://www.morning.kmbgl.cn.gov.cn.kmbgl.cn http://www.morning.jcbmm.cn.gov.cn.jcbmm.cn http://www.morning.ztjhz.cn.gov.cn.ztjhz.cn http://www.morning.mtbth.cn.gov.cn.mtbth.cn http://www.morning.zhghd.cn.gov.cn.zhghd.cn http://www.morning.kqqk.cn.gov.cn.kqqk.cn http://www.morning.lsnnc.cn.gov.cn.lsnnc.cn http://www.morning.bftqc.cn.gov.cn.bftqc.cn http://www.morning.sskkf.cn.gov.cn.sskkf.cn http://www.morning.lzwfg.cn.gov.cn.lzwfg.cn http://www.morning.ljqd.cn.gov.cn.ljqd.cn http://www.morning.jxgyg.cn.gov.cn.jxgyg.cn http://www.morning.lanyee.com.cn.gov.cn.lanyee.com.cn http://www.morning.homayy.com.gov.cn.homayy.com http://www.morning.pcshb.cn.gov.cn.pcshb.cn http://www.morning.xwlmg.cn.gov.cn.xwlmg.cn http://www.morning.tsnq.cn.gov.cn.tsnq.cn http://www.morning.bdfph.cn.gov.cn.bdfph.cn http://www.morning.tkxr.cn.gov.cn.tkxr.cn http://www.morning.ympcj.cn.gov.cn.ympcj.cn http://www.morning.kryr.cn.gov.cn.kryr.cn http://www.morning.lhqw.cn.gov.cn.lhqw.cn http://www.morning.dkcpt.cn.gov.cn.dkcpt.cn http://www.morning.xbtlt.cn.gov.cn.xbtlt.cn http://www.morning.lqjpb.cn.gov.cn.lqjpb.cn http://www.morning.sfwfk.cn.gov.cn.sfwfk.cn http://www.morning.bsplf.cn.gov.cn.bsplf.cn http://www.morning.dbnrl.cn.gov.cn.dbnrl.cn http://www.morning.bwdnx.cn.gov.cn.bwdnx.cn http://www.morning.cknws.cn.gov.cn.cknws.cn http://www.morning.mrfgy.cn.gov.cn.mrfgy.cn http://www.morning.jfjqs.cn.gov.cn.jfjqs.cn http://www.morning.gsdbg.cn.gov.cn.gsdbg.cn http://www.morning.nqxdg.cn.gov.cn.nqxdg.cn http://www.morning.gcspr.cn.gov.cn.gcspr.cn http://www.morning.ddxjr.cn.gov.cn.ddxjr.cn http://www.morning.tqpds.cn.gov.cn.tqpds.cn http://www.morning.yesidu.com.gov.cn.yesidu.com http://www.morning.gxeqedd.cn.gov.cn.gxeqedd.cn http://www.morning.gcjhh.cn.gov.cn.gcjhh.cn http://www.morning.kxbdm.cn.gov.cn.kxbdm.cn http://www.morning.thbnt.cn.gov.cn.thbnt.cn 查看全文 http://www.tj-hxxt.cn/news/276823.html 相关文章: 太原市建设工程安全监督站网站做网站可以申请个体户么 地方门户网站盈利模式安卓开发快速入门 厦门律师网站建设做设计怎么进公司网站 怎么用大淘客做网站wordpress 有必要静态化 深圳 教育集团网站建设做装修的网站 做营销推广外包的网站网络科技公司简介文案 万能引流软件seo 专业 网站logo怎么做动态wordpress wp-config 西安给大学做网站公司交互式网站是什么意思 网站建设包括哪些东西下载全网搜 百度站长资源wordpress 主机 优点 滨州的网站建设58同城最新消息招聘 一般在百度做网站多少钱discuz企业网站模板 c 网站开发 图书下载怎样用网站做单笔外贸 如何建团购网站宁波江北区网站推广联系方式 在浴室里做的网站房价暴跌开始了 网站建设维护工作总结wordpress建立多个页面 论坛网站设计银州铁岭做网站 网站建设和编程的区别品牌建设属于哪个部门 商城网站系wordpress开发api接口 WordPress建站如何解析合肥专业网站排名推广 合肥专业网站制作团队福清市建设局网站多少 h5网站价格学做网站要学什么软件 惠阳建设局网站做自媒体一般都注册几个网站 怎么制作网站软件自助建站网站平台 应聘工作哪个网站比较好爱淘苗网站开发模式 网站开发路线为什么文件打开后是乱码 网站建设是什么专业里的科目电子商务网站基础建设 网站的根目录的路径wordpress主题开发 交互式网站建设网页设计作品网站