-
/etc/passwd
User account information
account:password:UID:GID:Gecos:HomeDir:shell
Example: guru:x:464:464:Test account:/home/guru:/bin/bash
-
/etc/group
Group account information
group:password:GID:user1,user2,user3,etc.
example: Staff:x:200:bob,joe,sally
-
/etc/shadow
- Encrypted passwords are stored in root user read only files. Also controls advanced password parameters such as password aging.
- Structure:login name
- encrypted password
- date, in days since epoch, of last change
- number of days until change allowed
- number of days until change required
- number of days prior to expiration to begin warning
- number of days after expiration before account disabled
- date, in days since epoch, that password expires
-
useradd
- New users can be added to the system by the root user. useradd is controlled by:
- command line options
- /etc/login.defs config file
- /etc/default/useradd config file
-
userdel
deleting existing users
-
newusers
bulk import of new users
-
vipw
vigr
opens default EDITOR for editing
-
-
chfn
used to change user's GECOS/finger information
-
groupadd
creating new groups
-
groupdel
deleting existing groups
-
usermod -a -G
append group additions
-
preventing interactive login
7th field of /etc/passwd
- /bin/false -- simply exits with a return code 1
- /bin/nologin -- exits with message "This account is currently not available." or the contents of /etc/nologin.txt if it is present.
-
/etc/skel
When useradd is used the contents of this directory are copied of the the new user's home directory.
-
sudo
- like su but adds:
- ability to log commands run
- ability to give more granular access to privileged commands on a user-by-user basis
user must be in the /etc/sudoers file to use the command.
-
ulimit
Command provides control over the consumption of resources available to the shell and to processes started by it.
- -a -- All current limits are reported
- -c -- the max size of core files created
- -d -- the max size of a process's data segment
- -f -- the max size of files created by the shell
- -l -- the max size that may be locked into memory
- -m -- the max resident set size
- -n -- the max number of open file descriptors
- -s -- the max stack size
- -t -- the max amount of cpu time in seconds
- -u -- max # of processes available to a user
- -v -- max amount of virtual memory available to shell
-
/etc/profile
system wide sh: configuration files
-
~/.profile
per user sh: configuration files
-
Spawn a new shell and run sprit_name
- ./script_name
- sh script_name
-
Run script_name in the current shell
- source script_name
- . script_name
-
bash: Configuration Files
- when invoked as a login shell:
- /etc/profile then
- one of the three ~/.bash_profile, ~/.bash_login, ~/.profilethen ~/.bash_logout if it exists
when invoked as a sub shell, ~/.bashrc
-
add a default gateway
route add default gw 192.168.1.1
-
SQL: Insert
INSERT INTO table (field, ...) VALUES (values, ...)
- example:
- INSERT INTO restaurant (name, category_id, rating) VALUES ('Macho Taco', 3, 5);
-
SQL: UPDATE
UPDATE table SET field = 'value', ...WHERE condition, ...
example: - UPDATE restaurant SET rating = 4 WHERE name = 'Macho Taco';
-
SQL: Select
SELECT field, ...FROM table, ...WHERE condition, ...
- example:
- SELECT * FROM restaurant WHERE category_id = 2;
- output: 1|Macho Taco|2|5
-
SQL: Delete
DELETE FROM table WHERE condition, ...;
-
new aliases
#vi /etc/aliases --- edit to add aliases
# newaliases --- run to activate additions to aliases file
-
Executes a task once at some time in the future.
at or batch
-
Executes a task at a recurring interval
cron
-
At system boot, runs jobs missed while the system was off.
anacron
-
at -q
batch -q
- at uses queue "a" batch uses queue "b" by default. A-Z are available though.
- Queues with higher letters are run with increased niceness.
-
/etc/at.deny
/etc/at.allow
- if .deny exists, users that are listed in it can not use at; all others can.
- if .allow exists, only users in that list are allowed to use at.
-
/etc/cron.deny
/etc/cron.allow
- if .deny exists, users that are listed in it can not use cron; all others can.
- if .allow exists, only users in that list are allowed to use cron.
-
crontab -l
list/display the current cron table
-
crontab -e
edit the current cron table
-
crontab -r
removes the entire current cron table
-
Cron directories
- /etc/cron.d -- a more flexible crontab folder, allows specifying username.
- /etc/cron.hourly
- /etc/cron.daily
- /etc/cron.weekly
- /etc/cron.monthly
-
anacron config file
/etc/anacrontab
-
IPv4
- 32 bit
- contain 2 pieces (network,host)
-
private addresses
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
-
TCP
- connection oriented
- reliable
- 20 byte header
-
UDP
- connection-less
- stateless
- lightweight
- 8 byte header
-
System services
- /etc/services
- file that helps identify most of the commonly used ports.
-
-
-
-
-
TCP 25, 465
SMTP SSMTP (mail)
-
-
-
-
-
-
TCP 143, 993
IMAP IMAPS (email)
-
-
IPv6
- has 128bit addressing
- first appeared in 1996
- Header simpler
- improved end-to-end security
- Stateless auto-configuration
- Greatly expanded IP address space
-
common network interfaces
-
Ethtool
- +Enhanced functionality specific to Ethernet hardware
- +Dispay and configure Ethernet inerface settings
- +Display Available Options: ethtool (no parameters)
- +Display Setitngs on Inerface: ethtool eth#
- +
Configure basic settings: ethtool -s eth# OPTION VALUE
-
mii-tool
- + OLD!
- +Access to generic, hardware independent MII capabilities of most networking hardware
- +May work better than ethtool on some old hardware
-
Inerface configuration
- /sbin/ifconfig
- Start: ifconfig eth0 up
Stop: ifconfig eth0 down
-
Identifies name servers and name resolution options
/etc/resolv.conf
only allows three nameserver entries, any additional entries are ignored.
-
Identifies hostnames and aliases with IP addresses
/etc/hosts
-
Generates UDP probe packets, to hopefully unused ports, with increasingly larger TTL values.
-
mtr
A specialized traceroute like utility that sends ICMP Echo messages encapsulated in IP packets
mtr can output results in many formats including a real-time updating display (default).
-
netstat
can be used to print network connections, routing tables, interface statistics, and masqueraded connections.
- -rn view the routing table
- -s view protocol statistics
- -ta list all TCP connections and listening ports
- -ua list all UDP connections and listening ports
- -ape list TCP UDP and UNIX socket connections and their associtated state, user, program PID/name
-taupen lists everything. good one to remember.
-
scan list services listening on a remote machine
nmap
-
main X configuration file.
/etc/X11/xorg.conf
-
xwininfo
frints out info about specific window. Info includes:
- +placement
- +Geometry
- +color depth
-
xdpyinfo
X-display-info
Display info includes:
-
Different graphical logins
- xdm -- not really inuse anymore
- gdm -- standard
- kdm -- used but not standard
-
xhost
command used to control host-based access
xhost (+,-)server.example.com
-
xauth
- token-based X access control
- tokens stored in $XAUTHORITY file ( ~/.Xauthority is the most common file)
- uses the MIT_MAGIC_COOKIE_1
xauth add -- adds stores MIT-cookie
-
starting the X server
- startX starts the full graphical interface
- xinit starts X and opens a terminal
- X only starts the X server and nothing else
-
primary way of interacting with the hardware clock
hwclock
-
primary way of interacting with the system clock
date
-
command used to synchronize the local system clock to a remote system running an NTP deamon
-
deamon used to connect to NTP servers
-
ntpd config file
/etc/ntp.conf
-
/etc/syslog.conf
config file for the syslogd deamon
- +syntax
- +selectors
- +action
-
standard location for log files
/var/log
-
syslogd
- logs system messages
- conffigured in /etc/syslog.conf
- supports remote logging (-r option)
-
klogd
receives messages from the kernel and sends them to syslogd
-
message priority level
In order:
- emerg
- alert
- crit
- err
- warning
- notice
- info
- debug
-
open source SQL databases
-
commercial/closed source SQL Databases
-
create new aliases for email
newaliases
-
set up forward of mail
edit the "~/.forward" file
-
mail
send an email, reply to an email,
-
view the mail queue
mailq
-
|
|