linux授权:
r: read
w: write
x:execute
ch:change

b=byte
1byte=8 bits
u=user owner
g=group
o=other
a=all
_ _ _ _ _ _ _ _ _
r w x r w x r w x
u g o a
所有者授权

0 0 1 --->1 不可读,不可写,要执行
0 1 0 --->2 不可读 可写,不可执行
0 1 1 --->3 不可读 可写,可执行
1 0 0 --->4 可读,不可写,不可执行
1 0 1 --->5 可读,不可写,可执行
1 1 0 --->6 可读,可写,不可执行
1 1 1 --->7 可读,可写,可执行

【r=4、w=2、x=1】
文件拥有者仅有只读权限,而文件所属组用户具有读、写权限,其他用户具备读、写、执行三种权限可以写成下列命令:
chmod 467 test 【w=4、r=2、x=1】

[root@localhost tmp]# ls -al | grep test.txt
-rw-r--r-- 1 root root 20 06-19 01:50 test.txt

chmod u+x test.txt
chmod g+w test.txt
chmod o+x test.txt
chmod a+x test.txt
[root@localhost python]# chmod u+x,g+x,o+x hw.py

[root@localhost python]# cat hw.py
#!/usr/bin/python
print "hello world,this is my first python program"

[root@localhost python]# chmod u+x,g+x,o+x hw.py

[root@localhost python]# chmod a+x hw.py

[root@localhost python]# ./hw.py
hello world,this is my first python program

grp=group
chgrp=change group

own=owner
chown=change owner

练习:
使用root账户登录系统,在test10用户的家目录内新建一文件1.log
文件内容’hello, my name is hanmeimei’
更改文件的权限为640
任意新建一个组group10,组id6001
使1.log属于这个组group10(chgrp)
通过更改用户所属组的方法使得1.log能够被普通用户test10所访问

[root@localhost ~]# useradd test10
[root@localhost ~]# cat /etc/passwd | grep test10
test10:x:10008:10008::/home/test10:/bin/bash
[root@localhost ~]#
[root@localhost ~]# passwd test10
Changing password for user test10.
New UNIX password:
BAD PASSWORD: it does not contain enough DIFFERENT characters
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@localhost ~]#
[root@localhost ~]# cd /home/test10
[root@localhost test10]#
[root@localhost test10]# pwd
/home/test10
[root@localhost test10]#
[root@localhost test10]# vi 1.log

hello,my name is hanmeimei
~
"1.log" [New] 1L, 27C written
[root@localhost test10]#
[root@localhost test10]# ls -al | grep 1.log
-rw-r--r-- 1 root root 27 06-19 05:19 1.log
[root@localhost test10]# cat 1.log
hello,my name is hanmeimei
[root@localhost test10]#
[root@localhost test10]# chmod 640 1.log
[root@localhost test10]#
[root@localhost test10]# ls -al | grep 1.log
-rw-r----- 1 root root 27 06-19 05:19 1.log
[root@localhost test10]#
[root@localhost test10]# groupadd -g 6001 group10
[root@localhost test10]#
[root@localhost test10]# cat /etc/group | grep group10
group10:x:6001:
[root@localhost test10]#whoami
root

下面是使用test10登录:
[test10@localhost ~]$ whoami
test10
[test10@localhost ~]$ cd /home/test10
[test10@localhost ~]$
[test10@localhost ~]$ ls -al | grep 1.log
-rw-r----- 1 root root 27 06-19 05:19 1.log
[test10@localhost ~]$
[test10@localhost ~]$ cat 1.log
cat: 1.log: 权限不够
[test10@localhost ~]$
[test10@localhost ~]$ whoami
test10

下面切回来,再使用root用户操作:
[root@localhost test10]#whoami
root
[root@localhost test10]# chgrp group10 1.log
[root@localhost test10]#
[root@localhost test10]# ls -al | grep 1.log
-rw-r----- 1 root group10 27 06-19 05:19 1.log
[root@localhost test10]#
[root@localhost test10]# usermod -g group10 test10
[root@localhost test10]#
[root@localhost test10]# cat /etc/passwd | grep test10
test10:x:10008:6001::/home/test10:/bin/bash
[root@localhost test10]#
[root@localhost test10]#

下面是使用test10登录:
[test10@localhost ~]$ whoami
test10
[test10@localhost ~]$ cd /home/test10
[test10@localhost ~]$
[test10@localhost ~]$ ls -al | grep 1.log
-rw-r----- 1 root group10 27 06-19 05:19 1.log
[test10@localhost ~]$ cat 1.log ---->现在可以查看到1.log的内容了。
hello,my name is hanmeimei
[test10@localhost ~]$
[test10@localhost ~]$

文件类型
c--character 字符设备文件
b--block 块设备文件
两个设备文件的区别:
主要的区别是两个设备文件访问应用程序顺序不一样,是否可以随机访问
字符设备文件是按顺序来读取或是保存应用程序,按字节读取数据
块设备文件是随机读取或是保存应用程序,按块读取数据,1块=512B

/dev
dev=device

l 符号链接文件
l=link

[root@localhost tmp]# touch aaa
[root@localhost tmp]# ln aaa bbb
[root@localhost tmp]# ls -al | grep bbb
-rw-r--r-- 2 root root 0 06-19 06:21 bbb
[root@localhost tmp]#

手动修改网络地址:
[root@localhost tmp]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=static ---》static:手动配置静态IP地址
#BROADCAST=192.168.4.255
HWADDR=00:0C:29:56:D1:87
#NETWORK=192.168.4.0
IPADDR=192.168.17.14 ---》配置IP地址
NETMASK=255.255.255.0 ---》配置子网掩码
GATEWAY=192.168.17.1 ---》配置默认网关
ONBOOT=yes

重启网络服务
[root@localhost test10]# service network restart

关闭网络服务
[root@localhost test10]# service network stop

开启网络服务
[root@localhost test10]# service network start

[root@localhost home]# uname -a
Linux localhost.localdomain 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:54 EDT 2009 i686 i686 i386 GNU/Linux

系统名:Linux
主机名:localhost.localdomain
操作系统的发行版号:2.6.18-164.el5
内核版本号:#1 SMP Tue Aug 18 15:51:54 EDT 2009 kernel编译时固化下来的 内核编译次数,version文件记载,编译时间
机器硬件(CPU)名:i686
系统处理器的体系结构:i686
硬件平台:i386
操作系统:Gun/Linux

SSH:用于远程连接电脑 端口号:22
ssh工作:putty, secureCRT

winscp

在普通用户登录系统,切到root用户
su root

[test@localhost ~]$
[test@localhost ~]$
[test@localhost ~]$ su root
口令:
[root@localhost test]#
[root@localhost test]# whoami
root
[root@localhost test]#

linux简单授权的更多相关文章

  1. 一篇文章带你了解服务器操作系统——Linux简单入门

    一篇文章带你了解服务器操作系统--Linux简单入门 Linux作为服务器的常用操作系统,身为工作人员自然是要有所了解的 在本篇中我们会简单介绍Linux的特点,安装,相关指令使用以及内部程序的安装等 ...

  2. Security » Authorization » 简单授权

    Simple Authorization¶ 简单授权 82 of 86 people found this helpful Authorization in MVC is controlled thr ...

  3. [原创]linux简单之美(一)

    原文链接:linux简单之美(一) 话说windows也有syscall,这是必须的.但是win的syscall可以直接call吗?可以是可以但是破费周折,搞成SDT之类的复杂概念.下面看看linux ...

  4. [原创]linux简单之美(二)

    原文链接:linux简单之美(二) 我们在前一章中看到了如何仅仅用syscall做一些简单的事,现在我们看能不能直接调用C标准库中的函数快速做一些"复杂"的事: section . ...

  5. [原创]linux简单之美(三)

    原文链接:linux简单之美(三) 在linux简单之美(二)中我们尝试使用了C库的函数完成功能,那么能不能用syscall方式来搞呢?显然可以! section .data ft db sectio ...

  6. Linux学习之十七-配置Linux简单的脚本文件自启动

    配置Linux简单的脚本文件自启动 在Linux中使用shell脚本解决一些问题会比单独执行多条命令要有效率,脚本文件规定命名以.sh结尾,最基本的规则就是其内容是命令,想要脚本文件开机自启动,就需要 ...

  7. 五大Linux简单命令解决系统性能问题

    五大Linux简单命令解决系统性能问题 2010-12-17 10:07 James Turnbull TechTarget中国 字号:T | T 管理Linux主机的性能看起来经常象是在变魔术一样. ...

  8. Linux简单Shell脚本监控MySQL、Apache Web和磁盘空间

    Linux简单Shell脚本监控MySQL.Apache Web和磁盘空间 1. 目的或任务 当MySQL数据库.Apache Web服务器停止运行时,重新启动运行,并发送邮件通知: 当服务器磁盘的空 ...

  9. Linux简单了解

    Linux内核最初只是由芬兰人李纳斯·托瓦兹(Linus Torvalds)在赫尔辛基大学上学时出于个人爱好而编写的. Linux是一套免费使用和自由传播的类Unix操作系统,是一个基于POSIX和U ...

随机推荐

  1. Android应用瘦身

    转:https://zhuanlan.zhihu.com/p/25465537 瘦身的目的 从目的导向来看,我们是不会无缘无故去做一件事情的,那我们对应用瘦身的目的是为了什么?答案是:提高下载转化率. ...

  2. Android studio 配置忽略

    直接在Ignored Files选项里点击+号,在弹出的对话框选择第二项,然后依次输入上面包含的 .gradle .idea build 三个文件夹目录,再选择第一项,找到local.properti ...

  3. Cocos2d-x v3.1 坐标系统(五)

    Cocos2d-x v3.1 坐标系统(五) 为了能够更好的布局以及了解对象所在的位置,我们必须对Cocos2d-x中的坐标有详细的了解,本篇文章主要就是了解Cocos中用到的坐标系统.学过数学的人都 ...

  4. 您H1B身份的申请或H1B延期的申请提交对地方了吗?

    由于H1B配额的短缺,任何关于移民局对H1B申请的改动对马上要申请H1B的外国学生或专业人士来说都很重要.美国移民局在2007年3月5号发布了关于更改接收H1B身份申请或H1B延期申请的新政策. 申请 ...

  5. Metasploitable渗透测试实战——Windows漏洞 MS08-067复现

    Ms08-067 攻防环境: 攻击机:kali     ip:198.168.12.212 靶机:Window XP 未打过ms08-067补丁  ip:198.168.12.209

  6. pta 编程题12 堆中的路径

    其它pta数据结构编程题请参见:pta 这道题考察的是最小堆. 堆是一个完全二叉树,因此可用数组表示,一个下标为 i 的结点的父节点下标为 i / 2,子结点下标为 2i 和 2i + 1. 插入元素 ...

  7. SAP成都研究院C4C光明左使:SAP Cloud for Customer 使用SAP UI5的独特之处

    大家好,今天的文章来自我的同事,Yang Joey. 2017年7月,SAP成都研究院C4C开发团队刚刚建立.某个周一早晨的Scrum meeting,新出现一位眉清目秀的小伙子,向大家自我介绍:&q ...

  8. cesium 加载shp格式的白模建筑

    ceisum加载shp格式的建筑.有两种思路,目前推荐第二种. 方法一:将shp格式转换为geojson格式,然后采用cesium提供的接口加载到ceisum中. 严重缺陷:在面对大场景问题,即数据量 ...

  9. netcat 详解

    简介 netcat 是一款调试 TCP/UDP 网络连接的利器,常被称作网络调试的瑞士军刀,可见其功能强大. netcat 在 Linux, Windows 等各大操作系统上都有对应等发行版,以下以 ...

  10. python_68_迭代器

    ''' 我们已经知道,可以直接作用于for循环的数据类型有以下几种: 一类是集合数据类型,如list.tuple.dict.set.str等: 一类是generator,包括生成器和带yield的ge ...