简体   繁体   English

Ubuntu如何仅授予所有者读取权限

[英]Ubuntu how to give read permission only for owner

我只需要授予目录和子目录所有者的读取权限。没有其他用户可以读取目录中的文件。如何在命令行中执行此操作

chmod -R 700 directory_name递归地为您自己设置所有权限,其他则不保留。

You can use the find command for this: 您可以为此使用find命令:

find -type d -exec chmod 0500 {} \;

Note that read permissions only will not work for a directory to list it's contents. 请注意,仅读取权限对目录列出其内容无效。 Additionally the executable permission must be given. 此外,必须提供可执行权限。 Therefore 0500 因此0500

尝试这个 :

chmod -R 700 yourDir

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Ubuntu 上授予英特尔实感摄像头的权限 - how to give permission to intel realsense camera on Ubuntu 如何在Ubuntu中授予共享文件夹的权限? - How to give permission to share folder in Ubuntu? ubuntu 更改权限 hdd 硬只读 - ubuntu change permission hdd hard read only 如何授予 mysql 用户在 ubuntu 上创建和删除数据库的权限 - How to give a mysql user permission to create and delete database on ubuntu 如何为我的Laravel应用程序授予权限在目录中创建子文件夹(Ubuntu) - How to give permission for my Laravel application create subfolders in a directory (Ubuntu) 如何在 ubuntu 22.04 上给予正确的快门权限? - how to give proper snap permission to shutter on ubuntu 22.04? Ubuntu Python授予对树的完全许可 - Ubuntu Python give full permission to tree 授予在 Apache2 Z1D41C853AF58D3A77AE54990DCEZ9 上运行的 Python Flask 应用程序的权限 - Give permission to Python Flask application running on Apache2 ubuntu Wget Linux命令仅对sudo用户下载具有读取权限的文件-如何为所有用户赋予读取权限? - Wget Linux command is downloading files with Read Permissions for only sudo users - how to give Read permissions to all users? 如何授予makefile复制文件夹的权限? - How to give permission to a makefile to copy a folder?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM