zoukankan      html  css  js  c++  java
  • 权限管理[Linux]

    chown username file,... 改变文件的属主(只有管理员可以使用此命令)
    -R:修改目录及其内部文件的属主
    -reference=somefile_path file,...把想要设置属主的文件设置成和指定路径文件一样的
    chown username:groupname file,...
    chown username.groupname file...同时修改属主,属组
    -R
    -reference=somefile_path file,...
    chgrp grpname file,...修改属组
    -R
    -reference=somefile_path file,...
    chmod: 修改文件的权限
    修改三类用户的权限(u,g,o, a)
    chmod mode file...
    -R
    -reference=somefile_path file,...
    修改某类用户权限
    chmod 用户类别=mode file,....
    修改某类用户的某些位权限
    chmod 用户类别+|-mode file,...( chmod u+w /tmp/helloworld/)

    手动添加用户(添加到三个文件)
    [root@iZ28ec8xq8vZ openstack]# nano /etc/group
    [root@iZ28ec8xq8vZ openstack]# nano /etc/passwd
    [root@iZ28ec8xq8vZ openstack]# nano /etc/shadow
    [root@iZ28ec8xq8vZ openstack]# openssl passwd -1 -salt '123456'

    umask:遮罩号
    文件 666-umask
    目录 777-umask
    文件默认不能具有执行权限,如果结果具有可执行权限则解决+1
    umask027

    用户登录Shell类型
    登陆式shell:
    正常通过某终端登陆的shell;
    使用su -username/su -l username 登陆
    非登陆式shell
    su username;
    图像终端下打开的命令窗口
    自动执行的shell脚本

    bash的配置文件

    1. 全局配置
      /etc/profile,/etc/propfile.d/*.sh,/etc/bashrc
    2. 个人配置
      /.bash_profile,/.bashrc
      profile类的文件:
      设定环境变量
      运行命令或者脚本
      bashrc类的文件
      设定本地变量
      定义命名别名

    登陆式shll如何读取配置文件
    /etc/profile--->/etc/profle.d/.sh-->/.bash_profile--->/.bashrc-->etc/bashrc
    非登陆式shell如何配置文件
    ~/.bashrc -->etc/bashrc -->/etc/profile.d/
    .sh
    ls -l which passwd

  • 相关阅读:
    bzoj 1196: [HNOI2006]公路修建问题 二分+并查集
    bzoj 1607: [Usaco2008 Dec]Patting Heads 轻拍牛头 筛法
    bzoj 1050: [HAOI2006]旅行comf 并查集
    bzoj 1040: [ZJOI2008]骑士 树形dp
    bzoj 1295: [SCOI2009]最长距离
    bzoj 1070: [SCOI2007]修车 费用流
    bzoj 1057: [ZJOI2007]棋盘制作 单调栈
    bzoj 1059: [ZJOI2007]矩阵游戏 二分图匹配
    sass/scss 和 less的区别
    IONIC实现图片轮播
  • 原文地址:https://www.cnblogs.com/rohelm/p/5575867.html
Copyright © 2011-2022 走看看