Linux:Users, Groups, Rights
(Változatok közti eltérés) (Új oldal, tartalma: „= Permissions = <kivonat>chmod, chown, chgrp, id, su</kivonat> * Create an empty file in your home directory named Test! <megoldas> <code lang="bash"> feri@aries:~$ touch …”) |
(→Permissions) |
||
(7 közbeeső változat nincs mutatva) | |||
5. sor: | 5. sor: | ||
feri@aries:~$ touch Test | feri@aries:~$ touch Test | ||
</code></megoldas> | </code></megoldas> | ||
- | * | + | * Set permissions for this file: the owner must be able to read, write and execute, members of the group should read and execute, others do not have any permissions! <megoldas> |
<code lang="bash"> | <code lang="bash"> | ||
feri@aries:~$ chmod 750 Test | feri@aries:~$ chmod 750 Test | ||
</code></megoldas> | </code></megoldas> | ||
- | * Change the ownership of this file | + | * Change the ownership of this file! The new owner should be the system administrator! (Why doesn't it work?) <megoldas> |
<code lang="bash"> | <code lang="bash"> | ||
feri@aries:~$ chown root Test | feri@aries:~$ chown root Test | ||
24. sor: | 24. sor: | ||
<code lang="bash"> | <code lang="bash"> | ||
feri@aries:~$ chmod 4755 Test | feri@aries:~$ chmod 4755 Test | ||
+ | OR | ||
+ | feri@aries:~$ chmod u+s Test | ||
</code></megoldas> | </code></megoldas> | ||
* This file sould run with the group rights! <megoldas> | * This file sould run with the group rights! <megoldas> | ||
29. sor: | 31. sor: | ||
feri@aries:~$ chmod 2755 Test | feri@aries:~$ chmod 2755 Test | ||
</code></megoldas> | </code></megoldas> | ||
- | * Create a directory named TestDir! How can you reach | + | * Create a directory named TestDir! How can you reach that all users be able create files there but be able to to delete only their own files in it! <megoldas> |
<code lang="bash"> | <code lang="bash"> | ||
- | feri@aries:~$ mkdir | + | feri@aries:~$ mkdir testDir |
- | feri@aries:~$ chmod 1777 | + | feri@aries:~$ chmod 1777 testDir |
</code></megoldas> | </code></megoldas> | ||
* Create a directory named Common! It should be really common, all users must be able to create and delete any files in it. How can you reach it? <megoldas> | * Create a directory named Common! It should be really common, all users must be able to create and delete any files in it. How can you reach it? <megoldas> | ||
39. sor: | 41. sor: | ||
feri@aries:~$ chmod 777 Kozos | feri@aries:~$ chmod 777 Kozos | ||
</code></megoldas> | </code></megoldas> | ||
- | * Ask your own | + | * Ask your own identifier and your group identifier! <megoldas> |
<code lang="bash"> | <code lang="bash"> | ||
feri@aries:~$ id | feri@aries:~$ id |
A lap jelenlegi, 2024. március 21., 16:50-kori változata
Permissions
Kivonat: chmod, chown, chgrp, id, su
- Create an empty file in your home directory named Test!
- Set permissions for this file: the owner must be able to read, write and execute, members of the group should read and execute, others do not have any permissions!
- Change the ownership of this file! The new owner should be the system administrator! (Why doesn't it work?)
- Let the group of that file be the staff group! (Why doesn't it work?)
- Change its privileges to: rw-r--r--! What does it exactly mean?
- When other users run this file, they should have your rights. How can you reach that?
- This file sould run with the group rights!
- Create a directory named TestDir! How can you reach that all users be able create files there but be able to to delete only their own files in it!
- Create a directory named Common! It should be really common, all users must be able to create and delete any files in it. How can you reach it?
- Ask your own identifier and your group identifier!
- Change to an anoter user temporary! (Use your classmate's name and password!)
- Review the contens of the /etc/passwd and the /etc/group files! What are the meanings of fields in lines?