nano /etc/resolv.conf
nameserver 123.45.67.89
nameserver 123.45.67.90
chattr +i /etc/resolv.conf
chattr -i /etc/resolv.conf
ninjabionico ha scritto:Ora blocchiamo il file affinché il Network Manager non sia in grado di modificarlo.
- Codice: Seleziona tutto
# chattr +i /etc/resolv.conf
Con questo non sarà più possibile modificare il file a meno che non venga sbloccato con:
chattr: Operation not supported leggendo i flag di etc/resolv.conf
root@Laptop:~# chattr +i /etc/resolv.conf
root@Laptop:~# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 62.13.169.92
nameserver 62.13.169.93
root@Laptop:~# lsattr /etc/resolv.conf
----i-------------- /etc/resolv.conf
root@Laptop:~# rm /etc/resolv.conf
rm: impossibile rimuovere `/etc/resolv.conf': Funzione non permessa
root@Laptop:~#
CHATTR(1) CHATTR(1)
NAME
chattr - change file attributes on a Linux file system
SYNOPSIS
chattr [ -RVf ] [ -v version ] [ mode ] files...
DESCRIPTION
chattr changes the file attributes on a Linux file system.
The format of a symbolic mode is +-=[acdeijstuADST].
The operator `+' causes the selected attributes to be added to the
existing attributes of the files; `-' causes them to be removed; and
`=' causes them to be the only attributes that the files have.
The letters `acdeijstuADST' select the new attributes for the files:
append only (a), compressed (c), no dump (d), extent format (e),
immutable (i), data journalling (j), secure deletion (s), no tail-merg‐
ing (t), undeletable (u), no atime updates (A), synchronous directory
updates (D), synchronous updates (S), and top of directory hierarchy
(T).
The following attributes are read-only, and may be listed by lsattr(1)
but not modified by chattr: huge file (h), compression error (E),
indexed directory (I), compression raw access (X), and compressed dirty
file (Z).
Visitano il forum: Nessuno e 0 ospiti
megalab.it: testata telematica quotidiana registrata al Tribunale di Cosenza n. 22/09 del 13.08.2009, editore Master New Media S.r.l.; © Copyright 2008 Master New Media S.r.l. a socio unico - P.I. 02947530784. GRUPPO EDIZIONI MASTER Spa Tutti i diritti sono riservati. Per la pubblicità: Master Advertising