chmod - protect users' file being accessed so only owner can access?

我与影子孤独终老i 提交于 2019-12-06 20:24:48

问题


How to set chmod, so that ONLY owner of the file can read, write and execute? (other users cannot read, write, and execute)


回答1:


chmod 600 filename will do it; or chmod 700 if it is an executable.

Another way that is less cryptic is:

chmod go-rwx filename

  • The "g" is for group
  • The "o" is for others
  • The "-" is for removing permissions
  • The "r" is for read-permission
  • The "w" is for write-permission
  • The "x" is for execute permission.



回答2:


You can do the following command on the file:

chmod 744 filename


来源:https://stackoverflow.com/questions/28886936/chmod-protect-users-file-being-accessed-so-only-owner-can-access

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!