chown

【Linux下权限控制之chmod与chown命令】

孤街醉人 提交于 2019-11-28 09:46:36
原文: http://blog.gqylpy.com/gqy/316 chmod 用于配置文件/目录权限 命名格式: chmod [选项] 文件/目录名 . 权限类别: r 读取 可用数字 4 表示 w 写入 可用数字 2 表示 x 执行 可用数字 1 表示 . 归属类别: u 属主 g 属组 o 其它 a 所有人 . 操作符: + 给指定类别添加指定权限(例如+x或a+x表示允许所有人执行) - 删除指定类别的指定权限 = 重新定义指定类别的指定权限 . 示例 : chmod 755 file 给file文件重新定义权限为:属主rwx,属组rx,其它rx chmod -R a-w file 递归删除file目录及子目录的所有w权限 chown 用于更改文件/目录的属主和属组 命令格式: chown [参数] 用户名.组名 file 参数的话可使用 -R 递归,原理同上示例 原文: http://blog.gqylpy.com/gqy/316 来源: https://www.cnblogs.com/mypath1/p/11403595.html

linux 安装mysql (5.6)

。_饼干妹妹 提交于 2019-11-28 07:50:32
记录一下安装过程,不必每次都百度搜教程。 从mysql官网上下载自己适合的mysql版本https://dev.mysql.com/downloads/mysql/5.6.html#downloads 只不过要账号,我没有,自己改了一个wget地址下载的 wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.45-linux-glibc2.12-x86_64.tar.gz wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz 我自己安装的5.6 x64版本 首先进入/usr/soft,把文件下载到这里,或者把下载好的文件传到这个文件 没有soft文件夹就 mkdir soft新建一个 下面是我已经上传好的 解压tar -zxvf mysql-5.6.45-linux-glibc2.12-x86_64.tar.gz 得到解压后的文件 将解压后的文件重命名为mysql mv mysql-5.6.45-linux-glibc2.12-x86_64 mysql 把文件移到 /usr/local mv /usr/soft/mysql ./ 创建mysql用户组及用户 groupadd mysql

用户组相关命令 chown chmod

十年热恋 提交于 2019-11-28 06:30:56
chown 用户.用户组 文件用户和用户组可以只写一个,只修改用户组时,需要带前面的.号,.号可以用:代替 如果全部修改,可以加-R参数 userdel 删除用户账户和家目录 chattr和lsattr,加锁后root用户也无法解锁 i 如果对文件设置 i 属性,那么不允许对文件进行删除、改名,也不能添加和修改数据; 如果对目录设置 i 属性,那么只能修改目录下文件中的数据,但不允许建立和删除文件; a 如果对文件设置 a 属性,那么只能在文件中増加数据,但是不能删除和修改数据; 如果对目录设置 a 属性,那么只允许在目录中建立和修改文件,但是不允许删除文件; u 设置此属性的文件或目录,在删除时,其内容会被保存,以保证后期能够恢复,常用来防止意外删除文件或目录。 s 和 u 相反,删除文件或目录时,会被彻底删除(直接从硬盘上删除,然后用 0 填充所占用的区域),不可恢复。 来源: https://www.cnblogs.com/zhutao-niuniu2014/p/11397415.html

How to change the user and group permissions for a directory, by name?

丶灬走出姿态 提交于 2019-11-28 04:37:59
os.chown is exactly what I want, but I want to specify the user and group by name, not ID (I don't know what they are). How can I do that? import pwd import grp import os uid = pwd.getpwnam("nobody").pw_uid gid = grp.getgrnam("nogroup").gr_gid path = '/tmp/f.txt' os.chown(path, uid, gid) Since Python 3.3 https://docs.python.org/3.3/library/shutil.html#shutil.chown import shutil shutil.chown(path, user=None, group=None) Change owner user and/or group of the given path. user can be a system user name or a uid; the same applies to group. At least one argument is required. Availability: Unix.

why doesn't chown work in Dockerfile?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 04:37:34
My Dockerfile creates a directory, chown's it, and then lists the directory afterwards. The directory is still owned by root. Why is that? Here is the Dockerfile: FROM ubuntu:precise RUN useradd -d /home/testuser -m -s /bin/bash testuser RUN mkdir -p /var/local/testrunner/logs VOLUME ["/var/local/testrunner/logs"] RUN grep testuser /etc/passwd RUN grep root /etc/passwd RUN chown -R testuser:testuser /var/local/testrunner/logs RUN ls -ld /var/local/testrunner/logs Here is the output from "docker build": Sending build context to Docker daemon 10.24 kB Sending build context to Docker daemon Step

linux 权限命令行 xshell 切换用户

瘦欲@ 提交于 2019-11-28 04:19:22
一、 权限命令行 两种方式。 1.1 chown -R 指定的用户名, 权限的文件/文件夹 赋予这个用户的权限读写。 /*1.0 权限命令行 1. chown -R 指定的用户名 权限的文件/文件夹 赋予这个用户的权限读写。 演示 root 用户新建一个 111.TXT文件,touch 111.txt 创建的命令 touch 关键字 删除命令 rm -rf 123.txt 在Linux中 用Zxf 用户登录,发现,无法操作111.txt文件。 给他权限,来操作111.TXT 文件。 授权命令 chown -R zxf.txt (r 严格区分大小写。) chown -R 用户名 授权的文件/文件夹。 chown -R zxf 111.txt 当前的用户赋予指定的用户对某一个文件/文件夹可以 实现 rw 操作。(读 写) */ 1.2xshell 切换用户。 普通用户没有修改系统环境变量的权利 二、 chown 777 权限的文件/文件夹 /* 2.chown 777 权限的文件/文件夹 当前的用户赋予所有的用户 对某一个文件/文件夹可以rw(读写)操作。 前提是 当前的用户有对这个文件/文件夹的权限。 */ 来源: https://www.cnblogs.com/ZXF6/p/11392099.html

PHP mkdir and apache ownership

筅森魡賤 提交于 2019-11-28 04:04:51
问题 Is there a way to set php running under apache to create folders with the folder owned by the owner of the program that creates it instead of being owned by apache? Using word press it creates new folders to upload into but these are owned by apache.apache and not by the site that they are running in. This also happens using ostickets. For now we have to SSH into the server and chmod the folder, but it would seem there would be a setting somewhere to override the ownership outside of any

chown docker volumes on host (possibly through docker-compose)

筅森魡賤 提交于 2019-11-28 00:45:42
问题 I have the following example version: '2' services: proxy: container_name: proxy hostname: proxy image: nginx ports: - 80:80 - 443:443 volumes: - proxy_conf:/etc/nginx - proxy_htdocs:/usr/share/nginx/html volumes: proxy_conf: {} proxy_htdocs: {} which works fine. When I run docker-compose up it creates those named volumes in /var/lib/docker/volumes and all is good. However, from the host, I can only access /var/lib/docker as root, because it's root:root (makes sense). I was wondering if there

【Linux下权限控制之chmod与chown命令】

南笙酒味 提交于 2019-11-27 20:56:42
"> ## chmod 用于配置文件/目录权限 命名格式: chmod [选项] 文件/目录名 . 权限类别: r 读取 可用数字 4 表示 w 写入 可用数字 2 表示 x 执行 可用数字 1 表示 . 归属类别: u 属主 g 属组 o 其它 a 所有人 . 操作符: + 给指定类别添加指定权限(例如+x或a+x表示允许所有人执行) - 删除指定类别的指定权限 = 重新定义指定类别的指定权限 . 示例 : chmod 755 file 给file文件重新定义权限为:属主rwx,属组rx,其它rx chmod -R a-w file 递归删除file目录及子目录的所有w权限 chown 用于更改文件/目录的属主和属组 命令格式: chown [参数] 用户名.组名 file 参数的话可使用 -R 递归,原理同上示例 " 来源: https://www.cnblogs.com/zyk01/p/11376451.html

【Linux下权限控制之chmod与chown命令】

北城余情 提交于 2019-11-27 17:17:10
原文: http://blog.gqylpy.com/gqy/316 "> ## chmod 用于配置文件/目录权限 命名格式: chmod [选项] 文件/目录名 . 权限类别: r 读取 可用数字 4 表示 w 写入 可用数字 2 表示 x 执行 可用数字 1 表示 . 归属类别: u 属主 g 属组 o 其它 a 所有人 . 操作符: + 给指定类别添加指定权限(例如+x或a+x表示允许所有人执行) - 删除指定类别的指定权限 = 重新定义指定类别的指定权限 . 示例 : chmod 755 file 给file文件重新定义权限为:属主rwx,属组rx,其它rx chmod -R a-w file 递归删除file目录及子目录的所有w权限 chown 用于更改文件/目录的属主和属组 命令格式: chown [参数] 用户名.组名 file 参数的话可使用 -R 递归,原理同上示例 " 原文: http://blog.gqylpy.com/gqy/316 来源: https://www.cnblogs.com/gqy02/p/11371265.html