3 Kasım 2021 Çarşamba

chmod komutu ve Kullanılabilecek Gruplar

Giriş
Gruplar şöyledir.
u, for the owner
g, for the group
o, for others
a, for all, which can also be written as ugo.
chmod komutunu kullanırken komutun hangi gruplara uygulanacağını belirtebiliriz. Eğer belirtmezsek sanırım umask ayarımız devreye giriyor

Kullanım şöyle
chmod grouplar (+ veya eksi veya = karakteri başlayan permission) (dosya ismi)
Permission için açıklama şöyle
  • If we want to give permissions to a set of users or user, we write +, so +x will give execute permission and +rx will give read and execute permission.
  • If we want to revoke permissions, we write -, so -rwx takes away read, write, and execute access.
  • If we want to replace permissions entirely, we use =, so =r will give read access, but remove execute and write if they existed. Similarly, =rw is the same as read and write access, with execute removed if it existed.
Örnek - u
Şöyle yaparız
chmod u+r file.txt
Örnek - u
Şöyle yaparız. ugo yerine all da kullanılabilir.
chmod ugo+rw file.txt
Örnek - u
Şöyle yaparız. user'a rwx verir geri kalan hakları kaldırır. group'a rw verir geri kalan hakları kaldırır. owner'a r verir geri kalan hakları kaldırır
chmod u=rwx,g=rw,o=r file.txt

Örnek - a Yani All Anlamına Gelir
Şöyle yaparız
To set all the bits, ignoring umask, you need to specify who you want to set them for:

chmod a+rwx file

or more explicitly,

chmod ugo+rwx file
Örnek - Gruplar İçin Ayrı Ayrı
755'i vermek için harfleri kullanarak şöyle yaparız
chmod -R u=rwx,g=rx,o=rx folder
Örnek - MyGroup ve Owner
secret dizinindeki group ve owner için hakları almak için şöyle yaparız
chmod -R g=,o= secret

1 yorum:

  1. Hocam merhabalar.. komut öncesi ve komut sonrası görsel paylaşabilirseniz biz acemiler sizi daha iyi anlarız :).. emekleriniz için teşekkür ederim..

    YanıtlaSil