权限管理

权限

权限就是用户或者组对文件或者目录所拥有的能力,所能执行的操作。
权限的分配:
通过ls -l file这个命令可以查看文件或者目录的详细信息:
    [root@localhost home]# ls -l /root/
    total 4
    -rw-------. 1 root root 2633 Jul 25 21:08 anaconda-ks.cfg
    drwxr-xr-x  2 root root    6 Jul 31 23:24 Desktop
    drwxr-xr-x  2 root root    6 Jul 31 23:24 Documents

其中rwxr-xr-x代表了不同用户不同组的权限:
    左三位:定义user(owner)的权限(属主权限)
	中三位:定义group的权限(属组权限)
	右三位:定义other权限(其他用户权限)
进程安全上下文:
	进程对文件的访问权限应用模型:
		进程的属主(进程的发起者)与文件的属主是否相同,如果相同则应用属主权限。
		否则,则检查进程的属主是否属于稳健的属组:如果是,则应用属组权限。
		否则,就只能应用其他的权限
权限
r: readable,   读
w:writeable, 写
x:excuteable,执行
对文件来说:
	r:可获取文件的数据;
	w:可修改文件的数据;(但不能删除文件)
	x:可将此文件运行为进程;(针对二进制文件或脚本)
	(一般而言,文件默认情况下不该有执行权限)
对目录来说:
  
	r:可以使用ls获取其下的所有文件列表;但不能访问文件,不能cd进目录,不能查看文件的详细信息(元数据)
	w:可修改此目录下的文件列表;即创建或删除文件;配合x
	x:可cd至此目录中,且可使用ls-l来获取所有文件的详细属性信息;可以访问目录中的文件
	X:针对目录来说,在执行权限相关命令时,只给目录加x权限,目录下的文件不加x权限(前提是本身没有x权限),如果文件原本有x权限,则给文件也增加x权限。
权限的组合机制
二进制 八进制
对文件没有任何权限:   --- 	000	0
对文件有执行权限:     --x    	001  	1
对文件有写权限:       -w-	010	2
对文件有有写和执行权限:-wx	011	3
对文件有读权限:       r--	100	4
对文件有读和执行权限:  r-x	101 	5
对文件有读和写权限:    rw-	110 	6
对文件有读写执行权限:  rwx   	111 	7
权限管理命令
chmod命令:
	chmod [option]... MODE[,MODE]...FILE...
	chmod [option]... OCTAL-MODE FILE...
	chmod [option]... --reference=RFILE FILE...
三类用户:
	u:属主
	g:属组
	o:其他
	a:所有
(1)chmod [option]... MODE[,MODE]...FILE...

赋权表示法:直接操作一类用户的所有权限位rwx;		
    u=			修改属主的权限
    g=			修改属组的权限
	[root@localhost ~]# ll fstab 
	-rw-r--r-- 1 root root 595 Aug  2 19:38 fstab
	[root@localhost ~]# chmod g=rw fstab 
	[root@localhost ~]# ls fstab 
	fstab
	[root@localhost ~]# ll fstab 
	-rw-rw-r-- 1 root root 595 Aug  2 19:38 fstab

    o=			修改其他的权限
    a=			修改所有权限
	[root@localhost ~]# chmod u=rwx,g=rw,o= fstab 
	[root@localhost ~]# ll fstab 
	-rwxrw---- 1 root root 595 Aug  2 19:38 fstab
	可以组合使用:ug  	ou   og  	
授权表示法:直接操作一类用户的一个权限位r,w,x;
	u+,	u-
	[root@localhost ~]# chmod u-x fstab 
	[root@localhost ~]# ll fstab 
	-rw-rw---- 1 root root 595 Aug  2 19:38 fstab

	g+,	g-
	[root@localhost ~]# chmod g-wx fstab 
	[root@localhost ~]# ll fstab 
	-rwxr--r-- 1 root root 595 Aug  2 19:38 fstab

	o+,	o-
	[root@localhost ~]# chmod o+r fstab 
	[root@localhost ~]# ll fstab 
	-rw-rw-r-- 1 root root 595 Aug  2 19:38 fstab

	a+,	a-
	也可以以组合使用:ug+ ug-   uo+ uo- og+ og-
	[root@localhost ~]# chmod ug+x fstab 
	[root@localhost ~]# ll fstab 
	-rwxrwxr-- 1 root root 595 Aug  2 19:38 fstab

chmod  -x   去掉所有权限的执行权限
	[root@localhost ~]# chmod -x fstab 
	[root@localhost ~]# ll fstab 
	-rw-r--r-- 1 root root 595 Aug  2 19:38 fstab

chmod +w   只对属主有效(只有写权限只对属主有效)
	[root@localhost ~]# chmod +w fstab 
	[root@localhost ~]# ll fstab 
	-rw-r--r-- 1 root root 595 Aug  2 19:38 fstab

chmod +r   只对属主属组有效
	[root@localhost ~]# chmod +r fstab 
	[root@localhost ~]# ll fstab 
	-rwxr-xr-x 1 root root 595 Aug  2 19:38 fstab
(2)chmod [option]... OCTAL-MODE FILE...(八进制权限位)
	[root@localhost ~]# chmod 660 fstab 
	[root@localhost ~]# ll fstab 
	-rw-rw---- 1 root root 595 Aug  2 19:38 fstab
	注意:此方法必须至少有三位八进制位
(3)chmod [option]... --reference=RFILE FILE...(引用型修改)
	[root@localhost ~]# chmod --reference=/var/log/messages fstab 
	[root@localhost ~]# ll fstab 
	-rw------- 1 root root 595 Aug  2 19:38 fstab
	[root@localhost ~]# ll /var/log/messages
	-rw------- 1 root root 316661 Aug  2 20:01 /var/log/messages
				
选项:
-R, --recursive:递归修改:通常只有在授权表示法当中应用,在其他的三种方法中不建议使用。赋权表示法斟酌使用。
注意:用户只能修改属主为自己的那些文件的权限;
从属关系管理命令
chown,	chgrp(这两个命令的用法可以参考chmod命令用法)

chown命令:(属主)
    chown [OPTION]... [OWNER][:[GROUP]] FILE...
        (中间的冒号也可以用点号表示)
        [root@localhost ~]# ll testmod
        total 0
        -rw-r--r-- 1 root root 0 Aug  4 10:28 f1
        [root@localhost ~]# chown mageedu.mageedu testmod/f1
        [root@localhost ~]# ll testmod
        total 0
        -rw-r--r-- 1 mageedu mageedu 0 Aug  4 10:28 f1

   	chown [OPTION]... --reference=RFILE FILE...
   	    [root@localhost ~]# ll testmod
            total 0
            -rw-r--r-- 1 mageedu mageedu 0 Aug  4 10:28 f1
            -rw-r--r-- 1 root    root    0 Aug  4 10:47 f2
            [root@localhost ~]# chown --reference=testmod/f1 testmod/f2
            [root@localhost ~]# ll testmod
            total 0
            -rw-r--r-- 1 mageedu mageedu 0 Aug  4 10:28 f1
            -rw-r--r-- 1 mageedu mageedu 0 Aug  4 10:47 f2

   	选项:
   		-R:递归修改  			
chgrp命令:
	chgrp [OPTION]... GROUP FILE...
	chgrp [OPTION]... --reference=RFILE FILE...
 注意:只有管理员root方可修改属主属组
        [root@localhost ~]# ll testmod
        total 0
        -rw-r--r-- 1 mageedu mageedu 0 Aug  4 10:28 f1
        -rw-r--r-- 1 mageedu mageedu 0 Aug  4 10:47 f2
        -rw-r--r-- 1 root    root    0 Aug  4 10:52 f3
        -rw-r--r-- 1 root    root    0 Aug  4 10:52 f4
        [root@localhost ~]# chgrp mageedu testmod/f3
        [root@localhost ~]# ll testmod/f3
        -rw-r--r-- 1 root mageedu 0 Aug  4 10:52 testmod/f3
        [root@localhost ~]# ll testmod
        total 0
        -rw-r--r-- 1 mageedu mageedu 0 Aug  4 10:28 f1
        -rw-r--r-- 1 mageedu mageedu 0 Aug  4 10:47 f2
        -rw-r--r-- 1 root    mageedu 0 Aug  4 10:52 f3
        -rw-r--r-- 1 root    root    0 Aug  4 10:52 f4
        [root@localhost ~]# chgrp --reference=testmod/f3 testmod/f4
        [root@localhost ~]# ll testmod
        total 0
        -rw-r--r-- 1 mageedu mageedu 0 Aug  4 10:28 f1
        -rw-r--r-- 1 mageedu mageedu 0 Aug  4 10:47 f2
        -rw-r--r-- 1 root    mageedu 0 Aug  4 10:52 f3
        -rw-r--r-- 1 root    mageedu 0 Aug  4 10:52 f4
umask
umask:
	从目录或文件上屏蔽掉最大权限相应的位,从而得出默认权限。  	
	umask值  可以用来保留在创建文件权限
        新建FILE 权限: 666-umask
	如果所得结果某位存在执行(奇数)权限,则将其权限+1
	新建DIR 权限: 777-umask
	非特权用户umask是 002
	root 的umask 是022
        umask:  查看umask值
            [root@localhost ~]# umask
            0022
        umask #: 设定umask的值
            [root@localhost ~]# umask 026
            [root@localhost ~]# umask
            0026
        umask 002
        umask –S  模式方式显示 
        [root@localhost ~]# umask -S
        u=rwx,g=rx,o=x	umask –p  输出可被调用
	    [root@localhost ~]# umask -p
            umask 0022

	全局设置: /etc/bashrc  用户设置:~/.bashrc   	
	umask:文件的权限反向掩码,遮罩码;
   	创建文件时:666-umask
   	创建目录时:777-umask
   	注意:之所以文件用666去减,表示文件默认不能拥有执行权限;
	例如:	umask: 023
		666 - 023 = 643 	
		如果减得的权限中有执行权限,则需要将其权限加1
		目录则没有此项限制
		umask命令:	
		umask:查看当前umask
	        umask MASK:设置umask   注意:此类设定仅对当前SHELL进程有效
Linux文件系统上的特殊权限
SUID, SGID, Sticky
    此三种权限都是基于x权限上的。
三种常用权限:r, w, x user, group, other
前提:进程有属主和属组;文件有属主和属组	
(1)  任何一个可执行程序文件能不能启动为进程:取决发起者对程序文件是否拥有执行权限	
(2)  启动为进程之后,其进程的属主为发起者;进程的属组为发起者所属的组	
(3)  进程访问文件时的权限,取决于进程的发起者	
(a)  进程的发起者,同文件的属主:则应用文件属主权限	
(b)  进程的发起者,属于文件属组;则应用文件属组权限	
(c)  应用文件“其他”权限
  • 可执行文件上SUID权限:

    任何一个可执行程序文件能不能启动为进程:取决发起者对程序文件是否拥有执行权限
    启动为进程之后,其进程的属主为原程序文件的属主
    SUID 只对二进制可执行程序有效
    SUID 设置在目录上无意义
    权限设定:
    	chmod u+s FILE...
    	chmod u-s FILE...
    SUID 用八进制是4表示。例如,改权限的时候八进制是4755
      [mageedu@localhost root]$ cat /etc/shadow
      cat: /etc/shadow: Permission denied
      [mageedu@localhost root]$ exit
      exit
      [root@localhost ~]# chmod 4755 /bin/cat
      [root@localhost ~]# ll /bin/cat
      -rwsr-xr-x. 1 root root 54048 Nov 20  2015 /bin/cat
      [root@localhost ~]# su mageedu
      [mageedu@localhost root]$ cat /etc/shadow
      root:$6$Afpcf.Bd$w3ywPraRpplA4imtsyep02.a02lehv1amAFrg9qfSnrAO2Mj0Ca9aXpo5Bw4
      rpcuser:!!:17007::::::
      nfsnobody:!!:17007::::::
      postfix:!!:17007::::::
      sshd:!!:17007::::::
      ntp:!!:17007::::::
      tcpdump:!!:17007::::::
      mageedu:$6$S0t9SxXkvSI0Npz5$YDVonz69YGGGkGyZDy/KesO4CI1HUBLNThcHj6PXDntQGS0Cl0SNpN6zGASuzYE.z5veu1XAzMvO4xLWbKE.n0::0:99999:7:::
      user1:!!:17017:0:99999:7:::
      tom:!!:17017:0:99999:7:::
      user2:!!:17017:0:99999:7:::
      [mageedu@localhost root]$ exit
      exit
      [root@localhost ~]# chmod 755 /bin/cat
      [root@localhost ~]# ll /bin/cat
      -rwxr-xr-x. 1 root root 54048 Nov 20  2015 /bin/cat
  • 可执行文件上的SGID权限

    任何一个可执行程序文件能不能启动为进程:取决发起者对程序文件是否拥有执行权限
    启动为进程之后,其进程的属主为原程序文件的属组
    权限设定:
        chmod g+s FILE...
        chmod g-s FILE...
      [root@localhost ~]# ll /bin/cat
      -rwxr-xr-x. 1 root root 54048 Nov 20  2015 /bin/cat
      [root@localhost ~]# ll /etc/shadow
      ---------- 1 root root 1220 Aug  4 14:28 /etc/shadow
      [root@localhost ~]# chmod 2755 /bin/cat
      [root@localhost ~]# su tom
      [tom@localhost root]$ cat /etc/shadow
      cat: /etc/shadow: Permission denied
      [tom@localhost root]$ exit
      exit
      [root@localhost ~]# chmod g+r /etc/shadow
      [root@localhost ~]# su tom 
      [tom@localhost root]$ cat /etc/shadow
      root:$6$Afpcf.Bd$w3ywPraRpplA4imtsyep02.a02lehv1amAFrg9qfSnrAO2Mj0Ca9aXpo5Bw4L4kOAOU5rzB8asPw2siyNDNcd1:17007:0:99999:7:::
      bin:*:16659:0:99999:7:::
      daemon:*:16659:0:99999:7:::
      user1:!!:17017:0:99999:7:::
      tom:!!:17017:0:99999:7:::
      user2:!!:17017:0:99999:7:::
      [tom@localhost root]$
  • 目录上的SGID权限

    SGID作用在目录上时:
          将使在该目录中新建文件或目录将自动继承该目录所属组。
    默认情况下,用户创建文件时,其属组为此用户所属的主组
    一旦某目录被设定了SGID,则对此目录有写权限的用户在此目录中创建的文件所属的组为此目录的属组
    通常用于创建一个协作目录
    权限设定:
    	chmod g+s DIR...
    	chmod g-s DIR...SGID的八进制编号是2  
      [root@localhost testmod]# chmod 2777 /root/testmod/
      [root@localhost testmod]# ll -d
      drwxrwsrwx 2 root root 42 Aug  4 10:52 .
      [root@localhost testmod]# groupadd test
      [root@localhost testmod]# gpasswd -a tom test
      Adding user tom to group test
      [root@localhost testmod]# gpasswd -a mageedu test
      Adding user mageedu to group test
      [root@localhost testmod]# chgrp test /root/testmod
      [tom@localhost testmod]$ touch f5
      [tom@localhost testmod]$ ll f5
      -rw-rw-r-- 1 tom test 0 Aug  4 18:50 f5
      [tom@localhost testmod]$ echo "I am tom " >> f5
      [tom@localhost testmod]$ exit
      exit
      [root@localhost testmod]# su mageedu
      [mageedu@localhost testmod]$ echo "I am mageedu" >> f5 
      [mageedu@localhost testmod]$ cat f5  I am tom 
      I am mageedu
      [mageedu@localhost testmod]$

    对目录的SGID设置之后,目录所属组的成员之间,新建的文件,或者目录,可以相互访问修改。

  • Sticky位:粘滞位

具有写权限的目录通常用户可以删除该目录中的任何文件,无论该文件的权限或拥有者是用户本身
	在目录设置Sticky  位,只有文件的所有者或root可以删除该文件
	sticky  设置在文件上无意义
	权限设定:
			chmod o+t DIR...
			chmod o-t DIR...
    
    [root@localhost testmod]# ll
    total 4
    -rw-r--r-- 1 mageedu mageedu  0 Aug  4 10:28 f1
    -rw-r--r-- 1 mageedu mageedu  0 Aug  4 10:47 f2
    -rw-r--r-- 1 tom     tom      0 Aug  4 10:52 f3
    -rw-r--r-- 1 tom     tom      0 Aug  4 10:52 f4
    -rw-rw-r-- 1 tom     test    23 Aug  4 18:51 f5
    [root@localhost testmod]# su mageedu 
    [mageedu@localhost testmod]$ rm f3
    rm: remove write-protected regular empty file ‘f3’? y
    [mageedu@localhost testmod]$ ll
    total 4
    -rw-r--r-- 1 mageedu mageedu  0 Aug  4 10:28 f1
    -rw-r--r-- 1 mageedu mageedu  0 Aug  4 10:47 f2
    -rw-r--r-- 1 tom     tom      0 Aug  4 10:52 f4
    -rw-rw-r-- 1 tom     test    23 Aug  4 18:51 f5
    [mageedu@localhost testmod]$ exit
    exit
    [root@localhost testmod]# chmod o+t /root/testmod
    [root@localhost testmod]# ll -d
    drwxrwsrwt 2 root test 42 Aug  4 18:54 .
    [root@localhost testmod]# su mageedu
    [mageedu@localhost testmod]$ rm f4
    rm: remove write-protected regular empty file ‘f4’? y
    rm: cannot remove ‘f4’: Operation not permitted	6 :SUID,SGID	7 :SUID,SGID,Sticky
	在去除特殊权限的时候要用:
	    u-s    g-s   o-t
	用其他方法的话会有去不掉的情况

    SUID: user, 占据属主的执行权限位
        s:  属主拥有x 权限
        S :属主没有x 权限
    SGID: group, 占据属组的执行权限位
        s: group 拥有x 权限
        S :group 没有x 权限
    Sticky: other, 占据other 的执行权限位
        t: other 拥有x 权限
        T :other 没有x
  • 设定文件的特定属性

    chattr +i  不能删除,改名,更改
      [root@localhost test]# chattr +i test1
      [root@localhost test]# ll
      total 0
      -rw-r--r-- 1 root root 0 Aug  4 18:58 test1
      -rw-r--r-- 1 root root 0 Aug  4 18:58 test2
      [root@localhost test]# lsattr
      ----i----------- ./test1
      ---------------- ./test2
      [root@localhost test]# rm test1
      rm: remove regular empty file ‘test1’? y
      rm: cannot remove ‘test1’: Operation not permitted
      [root@localhost test]# mv test1 test3
      mv: cannot move ‘test1’ to ‘test3’: Operation not permitted
      [root@localhost test]# echo mmm >> test1
      -bash: test1: Permission denied
      [root@localhost test]# chattr +a  只能增加文件内容(目前使用nano或者echo)
      [root@localhost test]# chattr +a test1  
      [root@localhost test]# lsattr
      -----a---------- ./test1
      ---------------- ./test2
      [root@localhost test]# echo "mmm" >> test1
      [root@localhost test]# cat test1
      mmm
      [root@localhost test]# rm test1
      rm: remove regular file ‘test1’? y
      rm: cannot remove ‘test1’: Operation not permitted
      [root@localhost test]# mv test1 test3
      mv: cannot move ‘test1’ to ‘test3’: Operation not permitted
    
    lsattr 	  显示特定属性
    
    chattr +A file
    chattr -A file   锁定文件的atime  mtime  ctime 不能被改变
    
    chattr +i file 不能更改不能删除不能改名字
    
    使用lsattr查看
  • 访问控制列表

    setfacl  设置acl的命令
    	用户:setfacl -m u:user_name:mode file
    	组:  setfacl -m g:group_name:mode file
    		-x是取消设置
    	setfacl -x g:group_name:mode file
            setfacl -b file  清空所有对file设置的acl权限
    getfacl  查看acl权限
    
      ACL :Access Control List ,实现灵活的权限管理
    除了文件的所有者,所属组和其它人,可以对更多的用户设置权限
    CentOS7.0 默认创建的xfs 和ext4 文件系统有ACL 功能。
    CentOS7.X 之前版本,默认手工创建的ext4文件系统无ACL功能。需手动增加:
    	tune2fs –o acl /dev/sdb1
    	mount –o acl /dev/sdb1 /mnt
    ACL 生效 顺序:所有者,自定义用户,自定义组,其他为多用户或者组的文件和目录赋予访问权限rwx
    	• mount -o acl /directory
    
    	• getfacl file |directory
    	    获取文件或者目录的acl权限设置
    	  [root@localhost test]# getfacl /root/testmod
              getfacl: Removing leading '/' from absolute path names
              # file: root/testmod
              # owner: root
              # group: test
              # flags: -st
              user::rwx
              group::rwx
              other::rwx
    
    	• setfacl -m u:wang:rwx file|directory
    	    设置某个用户对文件或者目录的访问权限
    	  [root@localhost ~]# setfacl -m u:tom:x test
              [root@localhost ~]# su tom
              [tom@localhost root]$ ll test
              ls: cannot open directory test: Permission denied
    
    	• setfacl -Rm g:sales:rwX directory
    	    递归设置组对目录以及目录下的文件和子目录的访问权限。
          [root@localhost ~]# setfacl -Rm g:tom:rwX /root/test
          [root@localhost ~]# getfacl /root/tes
          # file: root/test
          # owner: root
          # group: root
          user::rwx
          user:mageedu:rwx
          group::r-x
          group:tom:rwx
          mask::rwx
          other::r-x
          [root@localhost ~]# ll -d test 
          drwxrwxr-x+ 3 root root 44 Aug  4 19:18 test
          [root@localhost ~]# ll test
          total 4
          -rw-rw-r--+ 1 root root 4 Aug  4 19:01 test1
          -rw-rw-r--+ 1 root root 0 Aug  4 18:58 test2
          drwxrwxr-x+ 2 root root 6 Aug  4 19:18 testdir
          [root@localhost ~]# getfacl test/test1
          # file: test/test1
          # owner: root
          # group: root
          user::rw-
          group::r--
          group:tom:rw-
          mask::rw-
          other::r--
          [root@localhost ~]# getfacl test/testdir
          # file: test/testdir
          # owner: root
          # group: root
          user::rwx
          group::r-x
          group:tom:rwx
          mask::rwx
          other::r-x
    
    	• setfacl -M file.acl file|directory
    	• setfacl -m g:salesgroup:rw file| directory
    	• setfacl -m d:u:wang:rx directory       
              默认acl权限:新建文件都有,原有文件不受影响,删除时用-k 删除默认权限
    	• setfacl -x u:wang file |directory
    	• setfacl -X file.acl directory
    mask :所有人除了所有者和other,其他所有人的权限都不能超过mask的权限,只能比他下或者跟他相同。
      
      ACL 文件上的group权限是mask值(自定义用户,自定义组,拥有组的最大权限), 而非传统的组权限
    	getfacl 可看到特殊权限:flags
    	默认ACL 权限给了x ,文件也不会继承x 权限。
    	base ACL  不能删除
    	setfacl -k dir  删除默认ACL 权限
    	setfacl -b file1 清除所有ACL 权限
    	getfacl file1 | setfacl --set-file=- file2 复制file1的acl 权限给file2
    
      mask 只影响除所有者和other 的之外的人和组的最大权限Mask 需要与用户的权限进行逻辑与运算后,才能变成有限的权限(Effective Permission)
    	用户或组的设置必须存在于mask 权限设定 范围内才会 生效。
    	setfacl -m mask::rx file
    	--set 选项会把原有的ACL 项都删除,用新的替代,需要注意的是一定要包含UGO 的设置,不能象-m 一样只是添加ACL 就可以.
    	如:
    	setfacl --set u::rw,u:wang:rw,g::r,o::- file1
  • 备份和恢复ACL

    主要的文件操作命令cp 和mv 都支持ACL ,只是cp 命令需要加上-p  参数。但是tar 等常见的备份工具是不会保留目录和文件的ACL 信息	
    • #getfacl -R /tmp/dir1 > acl.txt
      #setfacl -R -b /tmp/dir1	
    • #setfacl -R --set-file=acl.txt /tmp/dir1	
    • #getfacl -R /tmp/dir1

原创文章,作者:dxkboke,如若转载,请注明出处:http://www.178linux.com/29256

(0)
上一篇 2016-08-05 10:18
下一篇 2016-08-05 10:18

相关推荐

  • 浅谈TCP三次握手和四次分手

          TCP(Transmission Control Protocol传输控制协议)是一种面向连接的、可靠的、基于字节流的传输层通信协议提供可靠的连接服务,采用三次握手确认建立一个连接,比如我们去访问一个网站,从输入网址到页面显示我们所想要浏览的内容,这个过程其中就包含了小编要说的三次握手和四次挥手。 一、首先我们来了解…

    2017-09-02
  • Sed及Vim作业

      Sed及Vim作业题:     1、删除/etc/grub2.conf文件中所有以空白开头的行行首的空白字符    [root@localhost 7 ~]# sed -r  's/^[[:space:]]…

    Linux干货 2016-08-09
  • CentOS7的虚拟机安装

    刚学习linux下CentOS7的操作,熟悉一下CentOS7的安装,所以写一下CentOS7的安装教程,如果那里有写的不对的话希望得到指正。 我是在VMware下装的CentOS7 第一步配置硬件 先创建一个虚拟机 这里我选择的典型模式,新手嘛,新手难度的创建就好,高手难度的等新手难度熟练了再去碰好了,当然这是我的建议… 下一步然后光盘选择稍后…

    2017-07-15
  • 磁盘管理

    一、知识整理 1、每个扇区:512字节;每个柱面:256个磁头*63个扇区*512字节,大概为8M。centos6中分区使用起始结束柱面;centos7中分区使用起始结束扇区。EBR:扩展分区的第一个扇区。 2、MBR:master root record,1982年,使用32位表示扇区数,分区不超过2T。其中,一共512bytes字节,446bytes为b…

    Linux干货 2016-08-29
  • 网络N22期-第二周作业

    1、Linux上的文件管理类命令都有哪些,其常用的使用方法及其相关示例演示。 常用文件管理类命令有cp、mv、rm。 # cp命令:文件复制命令     cp [OPTION]… [-T] SOURCE DEST 单文件复制     cp [OPTION]… SOURC…

    Linux干货 2016-08-22
  • 早安

    既来之,则安之。好好学习,努力奋斗!!!#linux#

    Linux干货 2017-07-11

评论列表(1条)

  • 马哥教育
    马哥教育 2016-08-08 00:01

    重点突出,分类得当,标签精确