svcadm(8)을 검색하려면 섹션에서 8 을 선택하고, 맨 페이지 이름에 svcadm을 입력하고 검색을 누른다.
setlabel(1)
setlabel(1) User Commands setlabel(1)
NAME
setlabel - change effective sensitivity label of files
SYNOPSIS
/usr/bin/setlabel newlabel filename...
DESCRIPTION
The setlabel command applies the specified label to the files or direc‐
tories that exist within multilevel ZFS file systems. Refer to setfla‐
bel(3TSOL) manual page for a complete description of the conditions
that are required to satisfy this command, and the privileges that are
needed to execute this command.
When Trusted Extensions is enabled, setlabel can also be used with sin‐
gle-level file systems. In that case, files are moved into the zone
whose label corresponds to newlabel. The old file pathname is adjusted
so that it is relative to the root pathname of the new zone. If the old
pathname for a file's parent directory does not exist as a directory in
the new zone, the file is not moved. Once moved, the file might no
longer be accessible in the current zone.
Unless newlabel and filename have been specified, no labels are set.
Labels are defined by the security administrator at your site. The sys‐
tem always displays labels in uppercase. Users can enter labels in any
combination of uppercase and lowercase. Incremental changes to labels
are supported.
EXIT STATUS
setlabel exits with one of the following values:
0 Successful completion.
1 Usage error.
2 Error in getting, setting or translating the label.
USAGE
On the command line, enclose the label in double quotes unless the
label is only one word. Without quotes, a second word or letter sepa‐
rated by a space is interpreted as a second argument.
% setlabel SECRET somefile
% setlabel "TOP SECRET" somefile
Use any combination of upper and lowercase letters. You can separate
items in a label with blanks, tabs, commas or slashes (/). Do not use
any other punctuation.
% setlabel "ts a b" somefile
% setlabel "ts,a,b" somefile
% setlabel "ts/a b" somefile
% setlabel " TOP SECRET A B " somefile
EXAMPLES
Example 1 Set a Label
To set somefile's label to SECRET A:
example% setlabel "Secret a" somefile
Example 2 Turn On a Compartment
Plus and minus signs can be used to modify an existing label. A plus
sign turns on the specified compartment for somefile's label.
example% setlabel +b somefile
Example 3 Turn Off a Compartment
A minus sign turns off the compartments that are associated with a
classification. To turn off compartment A in somefile's label:
example% setlabel -A somefile
If an incremental change is being made to an existing label and the
first character of the label is a hyphen (-), a preceding double-hyphen
(--) is required.
To turn off compartment -A in somefile's label:
example% setlabel -- -A somefile
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
TRIBUTE VALUE _ Availabilitysystem/file_labeling _ Interface Stability‐
Committed
SEE ALSO
setflabel(3TSOL), label_encodings(5), attributes(7), labels(7), zfs(8)
NOTES
For more information, see the label_encodings(5) man page.
HISTORY
The setlabel command was added to Solaris in Solaris 10 4/08 (Update
5). Prior to that it was included in the Trusted Extensions add-on for
Solaris.
Oracle Solaris 11.4 21 Jun 2021 setlabel(1)