7
M A N A G I N G U S E R
E N V I R O N M E N T V A R I A B L E S
To get the most
from your Linux hacking
system, you need to understand environ-
ment variables and be adept at managing
them for optimal performance, convenience,
and even stealth. Among the areas that Linux new-
comers
find problematic, however, managing the user
environment variables might be the most difficult to
master. Technically, there are two types of variables: shell and environment.
Environment variables are process-wide variables
built into your system and
interface that control the way your system looks, acts, and “feels” to the
user, and they are inherited by any child shells or processes.
Shell variables,
on the other hand, are typically listed in lowercase
and are only valid in the
shell they are set in. To avoid over-explanation, I just cover some of the most
basic and useful skills for environment and shell variables in this chapter.
72
Chapter 7
Variables are simply strings in key-value pairs. Generally, each pair will
look like
KEY=value
. In cases where
there are multiple values, they will look
like
KEY=value1:value2
. As with most things in Linux, if there are spaces in the
value, it needs to be contained in quotation marks.
In Kali Linux, your envi-
ronment is your bash shell. Each user, including root,
has a default set of
environment variables that determine how the system looks, acts, and feels.
You can change the values for these variables to make your system work
more efficiently, tailor your work environment to
best meet your individual
needs, and potentially cover your tracks if you need to.