أذونات الملفات وملكيتها باستخدام chmod وchown
اربط بين إدارة المستخدمين والأمان بتعلّم كيفية عمل أذونات Linux، وكيفية ضبطها باستخدام chmod وchown.
أذونات الملفات وملكيتها باستخدام chmod وchown درس مجاني في Linux Command Line Mastery على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Linux Command Line Mastery، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Linux Command Line Mastery 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Permissions Connect Users and Files
Now that you can create users and groups, the next step is controlling what each user can do with files. Linux enforces this through file permissions and ownership.
Reading ls -l Output
ls -l shows a permission string like -rwxr-xr--. The first char is the file type; the next three triples are permissions for owner, group, and others.
ls -l /etc/passwdThe Three Permission Bits
r(read) = 4w(write) = 2x(execute) = 1
Add them per triple to get an octal digit. rwx = 7, r-x = 5, r-- = 4.
chmod with Octal
chmod 754 file sets owner rwx, group r-x, others r--.
chmod 754 script.sh
ls -l script.shchmod with Symbols
You can also add or remove specific bits: u=user, g=group, o=others, a=all.
chmod u+x script.sh
chmod go-w script.shMaking a Script Executable
A very common task: give a newly written script execute permission so you can run it directly.
chmod +x deploy.sh
./deploy.shChanging Ownership with chown
chown user:group file reassigns who owns a file. This ties directly into the user/group management you already learned.
sudo chown alice:developers project.txtChanging Only the Group
You can change just the group with chgrp or with the :group form of chown.
sudo chown :developers project.txtRecursive Changes
The -R flag applies changes to a directory and everything inside it. Use carefully.
sudo chown -R alice:developers /srv/appDefault Permissions and umask
New files get default permissions masked by umask. A umask of 022 removes write for group and others, producing 644 files and 755 directories.
umaskA Safe Workflow
When sharing a project directory with a team: set the group, grant group read/write, and keep others restricted.
sudo chown -R :developers /srv/app
sudo chmod -R 770 /srv/appQuick Check
What octal value represents rwxr-xr--?
Recap
You now control access to files:
- Permissions split into owner/group/others with r(4)/w(2)/x(1)
chmodsets modes via octal or symbolschown/chgrpreassign ownership-Rapplies recursively;umasksets defaults
تعلم Linux Command Line Mastery مع معلم ذكاء اصطناعي — مجانًا
اكتب وقم بتشغيل أكوادك الفعلية في المتصفح، واحصل على مساعدة فورية من معلم ذكاء اصطناعي متاح 24/7، واستمر من حيث توقفت على الويب أو في التطبيق.
- الدورات
- 12
- الدروس
- 48
الأسئلة الشائعة
هل درس «أذونات الملفات وملكيتها باستخدام chmod وchown» مجاني؟
نعم — نص درس «أذونات الملفات وملكيتها باستخدام chmod وchown» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Linux Command Line Mastery، انتقل إلى CoddyKit PRO. تتضمن دورة Linux Command Line Mastery 4 دروس في المجموع.
ماذا ستتعلم في «أذونات الملفات وملكيتها باستخدام chmod وchown»؟
اربط بين إدارة المستخدمين والأمان بتعلّم كيفية عمل أذونات Linux، وكيفية ضبطها باستخدام chmod وchown. تتمرن على Linux Command Line Mastery مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Linux Command Line Mastery؟
لا تُشترط خبرة سابقة. Linux Command Line Mastery على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.
كم من الوقت يستغرق درس «أذونات الملفات وملكيتها باستخدام chmod وchown»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Linux Command Line Mastery هذا؟
نعم. كل درس في Linux Command Line Mastery يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- إدارة المستخدمين والمجموعات: `useradd` و`usermod` و`groupadd`
- مقدمة إلى أوامر الشبكات: `ping` و`ip` و`netstat`
- الوصول الآمن عن بُعد: `ssh` و`scp`
- أذونات الملفات وملكيتها باستخدام chmod وchown