LPIC1.pt1 Flashcards
/etc/aliases.db
/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
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
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, FTP anonymous access for example, may also map to a root account for certain NFS configurations (i.e. the root_squash option))
dpkg-reconfigure [current desktop manager]
allows reconfiguration of display manager, screen should prompt for any installed DM (on Debian/Ubuntu systems)
/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)
[Journal]
SystemMaxUse= how much disk space the journal can use. default is 10%
RuntimeMaxUse= how much ram the journal can use. Default is 10%
SystemMaxFileSize= how large individual log files can get
RuntimeMaxFileSize= hot large log files can get in RAM
MaxRetentionSet= how long log files will be kept. default is 1 month.
cupsctl
used to control CUPS configuration, run with no options, displays the current configuration
ip forwarding
- the ability for your host to forward packets to another location and respond
- allows your system to function as a router
- two methods to enable:
1. echo 1 > /proc/sys/net/ipv4/ip_forward
2. edit /etc/sysctl.conf and add ‘net.ipv4.ip_forward=1’ - NOTE: method one is not permanent but will take immediate effect, method two requires a reboot (or combined with method one)
ect/securetty
defines where the root user is allowed to log in (if it does not exist, root can login from anywhere)
xdm
- display manager that is part of the Xorg software package
- /usr/bin
- directory where it will exist if installed
- xorg-x11-xdm
- package for the display manager
- not generally installed/used unless no full desktop environment is being used
- /etc/X11/xdm
- configuration directory
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’
var/log/journal
binary file wherein the systemd log is stored if configured to store log to disk (not default)
run/log/journal
binary file wherein the systemd log is stored if configured to store log to disk (default)
/var/lib/ntp/drift
file that track system time drift
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
- -o - specify new file to create
- 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 the VNCHOWTO.new.cyrillic
- NOTE: this is not a language translator, simply a character encoding translator
/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
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
xfs
- font server for X
* provides access to fonts for the X server
/etc/motd
if exists, displays the contents of this file when someone logs onto the system
logger
systemd-cat
- 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
can also be used in a script
systemd-cat is the journald version of logger
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
-Y - new more secure way to forward XWindows
ssh -Y user@host
systemd (logging)
- uses it’s own logging system called ‘journal’ (with ‘journald’ being the daemon for it)
- adopted on most modern systemd based distributions
- primarily, the difference lies in that the logging is done to a binary rather than plain text file, allowing you the ability to query metadata, command line details, PIDs, binaries and security privileges (some of which just are not available with a plain text file)
- because it is part of the service management system, all daemon messaging is automatically logged rather than the sysvinit variant of syslog wherein each service is responsible for how and what messages are logged
xwininfo
- displays a plethora of window information on the chosen window on the desktop
- running the command will present you with a special pointer to choose the window to query for info
/ect/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
hwclock
allows you to work with the hardware clock directly
- outputs the hardware clock date/time
- NOTE: the hardware clock is unaware of time zones
set the hardware clock to the current system time by using this command:
hwclock –systohc
Set hwclock to UTC:
sudo hwclock –systohc –utc
set the system time from the hardware clock by using the following command:
hwclock –hctosys
/etc/X11/xorg.conf
- the primary configuration file for the XWindows system
newer versions of xorg/Xserver dont use xorg.conf, but instead put configuration files into the /etc/X11/xorg.conf.d directory.
- major sections (exam)
- ServerLayout: Settings for “screen / input devices”-combinations
- Files: files that are used by your X server (i.e. fonts)
- Module: used to specify which Xorg server modules should be loaded.
- InputDevice - keyboards and mice (and perhaps special keypads if detected)
- Device - Settings for graphics card(s) and any driver references
- Monitor: - monitor(s) detected
- Screen: - Settings for “graphics card / display”-combinations. description of resolutions and color depths that are supported for the detected monitor and X server
- ServerFlags: - Common X server settings
Monitor: Settings for displays
getent
- utility to allow you to search both local (/etc/passwd and /etc/shadow) for account information as well as network sources (i.e. LDAP)
/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
/etc/ntp.conf
- pool of ntp servers
* defines drift file to track clock drift
netstat
- can print network connections, routing tables, interface stats, etc
- -a - show all sockets on active interfaces
- -c - refresh stats every 1 second
- -p - shows name and PID for each socket
- -t - show TCP stats
- -r - show the routing table
- -n - do not attempt name resolution (IP only)
- -l - display listening sockets only
ss
used to dump socket statistics. it allows showing information similar to netstat
kdm
- KDM display manager (legacy)
- uses QT libraries
- replaced by kwin and later lightdm (see below)
- /etc/kde/kdm
- configuration directory
- /usr/bin
- executable location
route
- displays the current routing table
- adds/removes routes as indicated
- for example - route add default gw 192.168.1.1
- would manually add a default gateway to the system going to 192.168.1.1
-n - dont do name resolution
del - delete a route.
add - add a new route.
-net - the target is a network.
-host - the target is a host.
netmask - when adding a network route, the netmask to be used.
gw - route packets via a gateway. NOTE: The specified gateway must be reachable first. This usually means that you have to set up a static route to the gateway beforehand.
rsyslog
alternative ‘fast’ version of syslog
/etc/adjtime
- contains values that track callibration to the clock and a final value to display time in LOCAL or UTC time
- if the file does not exist, no calibration has ever been done and time will default to UTC
/etc/ssh/sshd_config
main configuration for sshd (the service)
atq
- shows a summary of all jobs scheduled with ‘at’
- will not show the details, but a time and job id
- alias of: at -l
/var/log/message
where all log messages go (except mail)
/etc/nsswitch.conf
- determines the order that user account information is searched for on a system during login
- for example - password: files nis
shadow: files nis - will search for LOCAL files for account information and then search the remote user database configured if not found
/usr/share/zoneinfo
- the top level directory containing all time zone definitions
- NOTE: these are binary files and cannot simply by viewed on the console
/etc/default/useradd
contains the default values for the useradd command when those parameters are not used
unicode
- defines every character as a number (code point)
- originally encoded in 2 bytes, giving you 16k possible characters (called UCS-2)
- once again, the number of characters in this spec was exceeded
- UTF-16 was introduced to allow any character over 16k to be represented with a second pair of bytes
- UTF-8—A character encoding format that encodes all characters in a variable width using blocks of 8 bits. That is, characters are from 1-4 bytes long. UTF-8 is also backward compatible to 8 bit ASCII.
- UTF is the dominant encoding type
ntpdate
allows you to set the clock against the indicated ntp server
set
- shows all variables and functions in the current environment
- also allows the enable/disable of various shell features
/etc/localtime
the system time zone (can be a full time zone copy OR a link to the configured time zone)