Instructor Flashcards
/var/log/messages
Where all log messages go (except mail)
TCP Wrappers
- For
inetd
, using only/etc/hosts.allow
and/etc/hosts.deny
as parameters of tcpd -
xinetd
, the librarylibwrap.a
allows those services to use/etc/hosts.allow
and/etc/hosts.deny
ip
- Unified network and routing management command designed to replace the functionality of most of the other commands you need to know for the exam
- For example:
ip addr show
- Will provide you the same information as the generic
ifconfig
command
/etc/group
- Defines group-specific information like mapping of the group name to the group ID, other members of the group, etc.
- Groups can contain multiple users
TZ (variable)
- Allows you to override the system-wide time zone setting in the above directory
- Often set in a user’s home directory as part of the
.bashrc
file
/etc/aliases.db
- Database file that your local MDA will read to determine where to send email
- It has to be updated when any changes are made to the aliases on the system
if [["$?"=="0"]]
- Will determine if the preceding command succeeded or failed
- NOTE: The variable
"$?"
is a special variable that can be tested immediately after any command. If the value is0
, then the command succeeded (did not error), while any other value means the command failed.
usermod
- Modify the characteristics and/or membership of existing users
-
-c [description]
— Modifies the user description in the/etc/passwd
file -
-d [new home directory]
— Changes the user’s home directory -
-e [date]
— Change the date of account expiration -
-f [# days]
— Change the number of days after a password reaches max age the account will still allow login -
-g [GID]
— Change the user’s primary GID -
-G [GID]
— Change the user’s secondary GID(s) (can be multiple groups in a comma-delimited list) -
-s [path and file of login shell]
— Changes the full path and name of the default login shell for the user -
-u [UID]
— Changes the UID (NOTE: Will change home directory to match, but not any other user-owned files) -
-L
— Locks the user’s account -
-U
— Unlocks the user’s account
/etc/resolv.conf
Defines the system DNS servers and domains for name resolution
crontab
- Utility to allow the creation of jobs (specific to user running the command)
-
-l
— List all cron jobs for the logged-in user -
-e
— Edit the cron jobs for the logged-in user -
-u [username]
— Apply the option to the user indicated
dpkg-reconfigure tzdata
(Debian-based systems)
-
list-timezones
— List all the time zones to choose from -
set-timezone
[country/zone] — Set to the indicated time zone - Make the actual changes, setting the
/etc/localtime
system setting to the time zone chosen
tracepath6
IPv6 equivalent to tracepath
What subcommand of Git is used to change Git configurations?
git config
/bin/false
Returns a non-zero code to the request that will block any user request to log in
/etc/motd
If it exists, it displays the contents of this file when someone logs on to the system.
/etc/localtime
The system time zone (can be a full time zone copy OR a link to the configured time zone)
cupdisable
Disables the indicated printer (but will still accept jobs — will just hold in the queue)
~/.ssh/known_hosts
File containing the public key of known/trusted hosts that have connected to/from existing host by the user whose directory it exists in
/etc/skel
The contents of this directory can be copied to a new user’s home directory depending on how the user is added.
timedatectl
(Red Hat-based systems)
-
list-timezones
— List all the time zones to choose from -
set-timezone [country/zone]
— Set to the indicated time zone - Make the actual changes, setting the
/etc/localtime
system setting to the time zone chosen
UDP
User Datagram Protocol
* Often considered “complementary” to IP, but is a “stateless” connection. No error checking or retransmission of packets takes place, even if the transmission of the packet failed.
/etc/cron.deny
- Blacklist of users who cannot run cron jobs
- If this file exists and is empty, all users can access their crontabs and run jobs
- NOTE: Order of precedence will apply
cron.allow
and ignorecron.deny
if it exists
lp
- Command line (legacy) utilities for printing
- For example:
echo "my test print job" | lp
- Would print to the default printer the results of the
echo
command -
-d [printer]
—The destination printer (if not default) -
-n [#]
— Print indicated number of copies
/etc/cron.*
-
cron.d
— Custom job schedule configuration directory (system cron jobs) -
cron.hourly
— Jobs that run hourly -
cron.daily
— Jobs that run daily -
cron.weekly
— Weekly jobs -
cron.monthly
— Monthly jobs - NOTE: In all but
cron.d
, these directories are just scripts with no other scheduling information included in them and they will not always run at the same time, but will run within the specified time “frame.”
What is the default port used to log in to a host via SSH?
22
if [-f /home/user/testfile.txt]
Will test for the existence of a file called /home/user/testfile.txt
What command creates a new branch called “new-feature” in your current repository?
git branch new-feature
/sbin/nologin
Also blocks login requests, but returns a text message result
/etc/login.defs
Defaults for a user when created with the useradd
command
.bash_profile
- Located in a user’s home directory (e.g.,
/home/user
) - “Sourced” or executed second (if it exists) as part of the login process (after the global profile)
- Affects the current user’s environment (and ONLY that user’s environment)
LightDM
Works as a service
-
systemctl status lightdm
(systemd
systems) /etc/lightdm/lightdm.conf
- If it exists, will contain the configuration for the display manager
- Designed to be a lighter weight display manager (and replaced KDM)
/usr/share/doc/lightdm
- Directory containing sample configuration file
dig
-
[server] [domain] [record type]
— All optional except domain - Server — Specify a DNS server to use
- Domain — The specific domain to query for
- Record type — Different record types (e.g., NAME, CNAME, MX, etc.)
export
- Shows exported variables (when run alone)
- Keyword that, when preceding a variable, will allow the value to be passed on to other shells or children of the current shell (normal behavior is that the variable value is only visible in the current shell — referred to as “variable scope”)
The format of a cron job entry
[Minute 0–59] [Hour 0–23] [Day of Month 1–31] [Month 1–12] [Day of Week 0–7] [CMD]
Accessibility tools
- Sticky/repeat keys
- Slow/bounce/toggle keys
- Mouse keys
- High contrast/large print
- Screen reader
- Settings on some desktops
- Orca
- Emacspeak (for Emacs editor)
- Braille display
- Screen magnifier
- On-screen keyboard
- GOK (Gnome Onscreen Keyboard)
/etc/systemd/journald.conf
- Configuration file for
journald
* Common settings are for size of log and whether logging is forwarded to syslog as well (or installed equivalent)
traceroute6
IPv6 equivalent to traceroute
/etc/xinetd.conf
- Primary configuration file, including files in
/etc/xinetd.d
with files (one each) per service that is controlled - The request will come to the daemon, which will check for the service type and port and then scan for the appropriate service configuration file in
/etc/xinit.d
GPG
Utility working with keys for encrypting files and exchanging with third parties
What are two important configurations that should be set when working with Git?
user.name
* user.email
chage
- Change the aging parameters of the indicated user’s account and password
- Changes values in the
/etc/shadow
file -
-m [# days]
— How long a user must wait (in days) between password changes -
-M [# days]
— How long before a user must change their password -
-d [date]
— Sets the last changed value for the password -
-E [date]
— Changes the expiration value -
-I [# days]
— Number of days inactive after expiration or max limit before account is locked -
-W [# days]
— Warning for the number of days before a user must change their password -
-l
— Display all values for the indicated user
/etc/cron.allow
- Whitelist of users who can run cron jobs
* If this file exists and is empty, only root can access crontabs
What does the command uname -r
do?
Displays kernel release number
GDM
- Gnome Display Manager
-
/etc/gdb
— configuration directory -
/usr/bin
— executable directory
dpkg-reconfigure
[current desktop manager]
Allows reconfiguration of display manager; screen should prompt for any installed DM (on Debian/Ubuntu systems)
ssh
- Secure shell
- Related commands (also secure) —
scp
,ssh-agent
,ssh-add
-
-l [user] [host]
— Logs in as the specified user to the host -
[user]@[host]
— Logs in as the specified user to the host -
-X
— Enable SSH XWindow forwarding -
-x
— Disable SSH XWindow forwarding
What command lists your current working directory?
pwd
What Git sub-command provides a short listing of a repository change log?
git log --oneline
XDM
- Display manager that is part of the Xorg software package
- ` /usr/bin` is the directory where it will exist if installed
-
xorg-x11-xdm
is the package for the display manager - Not generally installed/used unless no full desktop environment is being used
-
/etc/X11/xdm
is the configuration directory
/etc/bashrc
- Located in
/etc
- Global configuration file that applies its settings to all user environments (as long as they use bash)
- “Sourced” or executed after the profile from the user’s
.bash_profile
if it exists - Commonly used to define aliases and functions for the environment for all users
Special UID`s
- UID 0 — Root/admin user on any system
- UID 1 —
bin
user (system binaries and nonlogin accounts) - UID 48 — Apache user (if installed)
- UID 99 — “Nobody” account (used for a variety of things, including FTP anonymous access; may also map to a root account for certain NFS configurations (e.g., the root_squash option))
logger
- Allows you or a command to log a message to
/var/log/messages
- CTL-D to end and write the message
-
-i
— Passed additional information to syslog
/etc/default/useradd
Contains the default values for the useradd
command when those parameters are not used
read FIRSTNAME
Will prompt user for a FIRSTNAME
and store it in that variable to be used later
/var/log/journal
Binary file where the systemd
log is stored
cupsaccept
By indicating a printer name, it will set that printer to accept all submitted jobs
ntpq
- Query an ntp server for stats and connect to local system by default
- Special prompt
- Peers — Time hosts already associated with
- Associations — More details on each server
ntp / ntpd
- Network Time Protocol
- Network Time Protocol daemon (service)
- Allows you to define a pool of network servers that are synchronized to a globally distributed network of time servers
- Those that get a time update from a “reference” clock (like the naval observatory in the USA) are called “stratum 1 servers”
ASCII
- American Standard Code for Information Interchange
- Encoded into seven bits, giving 128 total possible characters
- English encoding
- Once those characters ran out, storing went to eight bits, giving another 128 possible characters
/usr/share/zoneinfo
- The top-level directory containing all time zone definitions
- NOTE: These are binary files and cannot simply be viewed on the console
/etc/sysconfig/network-scripts
- A directory containing a host of scripts responsible for the configuration of all interfaces on the system
- For example,
ifcfg-eth1
- Responsible for the configuration (static or DHCP) of the address information for the ETH1 interface on your system
- Changes to the network interface configuration are applied by restarting the network service
- For example, service network restart
ssh-keygen
- Creates a public/private key pair for use with SSH
-
-b [#]
— Encryption key size (e.g., 1024, 2048, etc.) -
-t [type]
— Encryption key type (DSA or RSA — RSA is more secure and is currently the default) - Will prompt for a password — blank will allow you to use the key to log in completely without password, whereas entering a passphrase effectively creates two-factor authentication (key + passphrase)
- File permissions on keys should be either 644 (older) or 600 (newer)
/etc/cups
- Configuration directory for CUPS
- Configuration file list:
-
classes.conf
— Configures class definitions -
cupsd.conf
— Primary configuration file for the daemon -
cupsd.conf.default
— Sample default configuration file to revert to as backup -
printers.conf
— Configuration of each printer on the system -
ppd
— Directory of PPD (printer driver files) on each printer on the system
anacron
- “Simplified” cron, used to augment crond
- Runs jobs that can be run with less time precision, particularly catching up on running jobs that were scheduled while the system was shut off
/etc/logrotate.conf
- Primary configuration for log rotation (defaults and system files to rotate)
- Each file in
logrotate.d
adds or overrides settings to the defaults in the configuration file - NOTE: Files in
logrotate.d
are usually added/maintained by the package manager as part of the install/update/removal of packages
groupmod
- Modify the characteristics of the indicated group
* -g [GID]
— Alters the GID of the indicated group
How can you copy a branch from one repository into the origin repository?
git push origin
cupsreject
By indicating a printer name, it will set that printer to reject all submitted jobs
True or False: Branching is an efficient operation in Git.
True. This is one of the notable features of Git.
xinetd
Replacement for inetd
, allowing more granular control of services
/etc/aliases
- Ability to refer to a user by another name/account
- For example (entry in file) —
sysadmin: root
would indicate that an email arriving on the system for thesysadmin
account would actually be delivered toroot
- Format of an alias —
alias: account[,another,another]
- The brackets are optional, defining multiple accounts that an alias refers to is in a comma-delimited list
iconv
- A utility used to convert between character encodings
-
-c
— Clears unknown characters -
-f [type]
— From indicated type -
-t [type]
— To the indicated type -
-l
— Lists all available encoding types - For example —
iconv -c -f ASCII -t MACCYRILLIC VNCHOWTO > VNCHOWTO.new.cyrillic
- Would clear any unknown characters in the file stream from VNCHOWTO and convert from ASCII to MACCYRILLIC encoding, writing the new file to VNCHOWTO.new.cyrillic
- NOTE: This is not a language translator — simply a character encoding translator