روی PC خونه چندتا یوزر ساختم که استفاده بقیه از کامپیوتر به تنظیمات آسیب نرسونه! اما نیاز داشتم که همه کاربرها بتونند فایلهای بعضی پوشه ها رو Read & Write کنند. یعنی بعضی داده هام مثل کتابها، آهنگها و فیلم ها رو با همه Share کنم.
توی جستجوها به bindfs (https://github.com/mpartel/bindfs) رسیدم که از سافتور سنتر نصب میشه.
مجوز: GNU GPL v2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
Examples: Here are some examples of what bindfs can do for you
Make a directory read-only for non-root users
bindfs --perms=a-w somedir somedir
Share a directory with some other users without modifying /etc/group
bindfs --mirror-only=joe,bob,@wheel ~/some/dir shared
Make your website available to the webserver process read-only
bindfs --owner=www --perms=0000:u=rD ~/stuff/website ~/public_html
Make all new files uploaded to an FTP share owned by you and seen by everyone
bindfs --create-for-user=me --create-with-perms=u+rw,a+rD /var/ftp/uploads /var/ftp/uploads
راهنماها:
https://code.google.com/p/bindfs/wiki/Installation (https://code.google.com/p/bindfs/wiki/Installation)
http://cs.helsinki.fi/u/partel/bindfs_docs/bindfs-help.txt (http://cs.helsinki.fi/u/partel/bindfs_docs/bindfs-help.txt)
http://cs.helsinki.fi/u/partel/bindfs_docs/bindfs.1.html (http://cs.helsinki.fi/u/partel/bindfs_docs/bindfs.1.html)
این پست رو دادم برای معرفی و هم اینکه اگر کسی راه حل دیگه ای برای موضوع داره ارائه کنه.
3755 چه سطحی از دسترسیه؟
چیزی به نام 3755 نداریم!
دسترسیها به این صورت است:
و سه عدد داریم مثلا ۷۷۷
که به ترتیب از چپ:
- مالک فایل
- گروه مالک فایل
- هرکسی
مجوزها با ترکیب این اعداد درست میشن مثلا:
۶۴۴ مالک میتونه بخونه، بنویسه و بقیه فقط بخونن
۷۱۱ مالک میتونه بخونه، بنویسه و اجرا کنه ولی بقیه فقط میتونن اجرا کنن
۷۷۷ هرکسی میتونه هم بخونه، هم بنویسه و هم اجرا کنه
Special Mode Bits
The setuid, setgid, and sticky bit can be set using chmod where 1 = sticky bit, 2 = setgid, 4 = setuid.
For example to set the setuid bit along with permissions 766,
chmod 4766 filename
To set the setgid bit along with 776,
chmod 2776 filename
To set sticky bit along with 766:
chmod 1776 fileanme
To set both setuid(2) and setgid(4) along with 766, prepend with 6. i.e. 2+4:
chmod 6766 filename
- منبع (http://www.tutonics.com/2012/12/linux-file-permissions-chmod-umask.html)
- http://www.techrepublic.com/blog/it-security/understand-the-setuid-and-setgid-permissions-to-improve-security/ (http://www.techrepublic.com/blog/it-security/understand-the-setuid-and-setgid-permissions-to-improve-security/)
- https://en.wikipedia.org/wiki/Setuid (https://en.wikipedia.org/wiki/Setuid)
- اگه اشتباه نکنم توی کتاب the linux command line (http://linuxcommand.org/tlcl.php) هم توضیح داده این موضوعُ.