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

前端 未结 2 1863
迷失自我
迷失自我 2021-02-19 00:35

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

相关标签:
2条回答
  • 2021-02-19 01:00

    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.
    0 讨论(0)
  • 2021-02-19 01:14

    You can do the following command on the file:

    chmod 744 filename
    
    0 讨论(0)
提交回复
热议问题