Files/Directories
CHFLAGS

Each file has an assigned set of mode bits, ownership (user and group), and flags. To view these assignments, run the command ls -lo and get a result like this (only one file is shown)
-rw-r--r-- 1 root wheel sappnd,arch 2188 Sep 17 2003 junk.test

The first grouping of characters represent the modes assigned to the file.
root is the file's owner
wheel is the file's group
sappnd,arch are the file's flags

chmod changes the file's mode
chown changes the file's owner
chgrp changes the file's group
chflags changes the file's flags

archset the archived flag
opaqueset the opaque flag (owner or superuser only)
nodumpset the nodump flag (owner or superuser only)
sappndset the system append-only flag (superuser only)
schgset the system immutable flag (superuser only)
uappndset the user append-only flag (owner or superuser only)
uchgset the user immutable flag (owner or superuser only)


Putting the letters ``no'' before a flag name causes the flag to be turned off. For example:
nouchg the immutable bit should be cleared

The superuser-settable ``sappnd'' and ``schg'' flags can be set at any time, but may only be cleared when the system is running at security level 0 or -1 (insecure or permanently insecure mode, respectively). The securelevel is normally set to 0, for example, when running in single-user mode.

To get into single-user mode (insecure) :
kill -s TERM 1
The system will then reboot into the single user mode, allowing the immutable bits to be cleared. (OpenBSD needs a terminal type entry - you can use VT220 for this)