Technopedia Center
PMB University Brochure
Faculty of Engineering and Computer Science
S1 Informatics S1 Information Systems S1 Information Technology S1 Computer Engineering S1 Electrical Engineering S1 Civil Engineering

faculty of Economics and Business
S1 Management S1 Accountancy

Faculty of Letters and Educational Sciences
S1 English literature S1 English language education S1 Mathematics education S1 Sports Education
teknopedia

teknopedia

teknopedia

teknopedia

teknopedia

teknopedia
teknopedia
teknopedia
teknopedia
teknopedia
teknopedia
  • Registerasi
  • Brosur UTI
  • Kip Scholarship Information
  • Performance
  1. Weltenzyklopädie
  2. chattr - Teknopedia
chattr - Teknopedia

chattr (abbreviazione dalla lingua inglese di Change attributes, Cambia attributi) è un comando dei sistemi operativi Unix e Unix-like che consente di modificare gli attributi dei file memorizzati su un filesystem di tipo ext2/ext3.

Sintassi

[modifica | modifica wikitesto]
 chattr [ -RVf ] [ -v version ] [ modalità ] files

Le opzioni sono:

  • -R che effettua una ricerca ricorsiva
  • -V verboso
  • -f sopprime i comuni messaggi di errore

Le modalità possono essere impostate con il simbolo + per aggiungere un attributo o - per rimuoverlo

Il comando associato a chattr è lsattr che consente di elencare gli attributi impostati sui files.

Attributi

[modifica | modifica wikitesto]

Gli attributi estesi, che non vanno confusi con quelli impostabili con il comando chmod, riguardano particolarità specifiche dei filesystem ext2/3. In taluni casi questi attributi potrebbero essere impostati dolosamente da cracker o da rootkit per rendere più complessa l'eliminazione di un file di sistema compromesso o, viceversa, usato dai sistemisti per irrobustire un sistema (ad esempio settando il flag a sui file di log, rendendoli non cancellabili).

  • A non aggiornare l'atime
  • S aggiornamento sincrono
  • D aggiornamento sincrono delle directory
  • a solo append
  • c compresso
  • d non effettuare dump
  • i immutabile
  • s cancellazione sicura
  • T top of directory hierarchy
  • j data journaling
  • t no tail-merging
  • u non cancellabile

Esempi di utilizzo

[modifica | modifica wikitesto]

Generazione di un file di test:

# touch pippo.txt

Visualizzazione degli attributi:

# lsattr pippo.txt
-----------------e- pippo.txt

Impostazione degli attributi di immutabilità con il comando chattr e nuova visualizzazione:

# chattr +i pippo.txt
# lsattr pippo.txt
----i------------e- pippo.txt

Tentativo di rimozione del file con permessi di immutabilità:

# rm pippo.txt 
rm: impossibile rimuovere "pippo.txt": Operazione non permessa

Con i permessi di immutabilità è impossibile anche scrivere sul file:

# echo "ciao" >> pippo.txt
bash: pippo.txt: Permesso negato

nonostante i permessi del file lo consentano:

# whoami
root
# ls -l pippo.txt
-rw-r--r-- 1 root root 0 2011-08-23 22:53 pippo.txt

Nota

[modifica | modifica wikitesto]

Alcuni attributi con il tempo non sono stati mantenuti, come il caso dell'attributo read only (r).

Voci correlate

[modifica | modifica wikitesto]
  • lsattr

Collegamenti esterni

[modifica | modifica wikitesto]
  • (EN) chattr: change file attributes on a Linux second extended file system, in Unix man pages. URL consultato il 23-08-2011 (archiviato dall'url originale il 7 gennaio 2013).
V · D · M
Programmi Unix/Unix-like con interfaccia a riga di comando e comandi interni della shell unix
File systemcat · cd · chattr · chmod · chown · chgrp · cksum · cmp · cp · du · df · fdisk · file · fsck · fuser · gzip · ln · ls · lsattr · lsof · mkdir · mknod · mount · mv · pwd · rm · rmdir · split · tar · touch · umount · umask
Processiat · chroot · crontab · exit · kill · killall · nice · nohup · pgrep · pidof · pkill · ps · pstree · sleep · time · top · wait
Ambiente utentealias · env · export · finger · id · logname · mesg · newgrp · passwd · su · sudo · uname · uptime · w · wall · who · whoami · write
Elaborazione testoawk · comm · cut · diff · ed · ex · fmt · head · iconv · join · less · more · paste · sed · sort · tail · tr · uniq · vi · wc · xargs
Script di shellbasename · dirname · echo · expr · false · printf · test · true · unset
Retedig · nslookup · ifconfig · netstat · ping · rcp · rlogin · route · netcat · traceroute
Ricerchefind · grep · strings
Amministrazionedmesg · groupadd · groupdel · groupmod · mdadm · shutdown · useradd · userdel · usermod
Altribanner · bc · cal · clear · date · dd · lp · man · size · tee · tput · yes
  Portale Sicurezza informatica: accedi alle voci di Teknopedia che trattano di sicurezza informatica
Estratto da "https://it.wikipedia.org/w/index.php?title=Chattr&oldid=116345728"

  • Indonesia
  • English
  • Français
  • 日本語
  • Deutsch
  • Italiano
  • Español
  • Русский
  • فارسی
  • Polski
  • 中文
  • Nederlands
  • Português
  • العربية
Pusat Layanan

UNIVERSITAS TEKNOKRAT INDONESIA | ASEAN's Best Private University
Jl. ZA. Pagar Alam No.9 -11, Labuhan Ratu, Kec. Kedaton, Kota Bandar Lampung, Lampung 35132
Phone: (0721) 702022