Distributions:
General:
Services:
Misc How-To:
Configurations:
Links:
Debian Codenames / Releases
1.1 buzz
1.2 rex
1.3.x bo
2.0 hamm
2.1 slink
2.2 potato
3.0 woody
3.1 sarge
4.0 etch (current: stable)
4.? lenny (current: testing)
?.? squeeze
0.0 sid (sid is always the unstable distribution)
http://www.debian.org/doc/FAQ/ch-ftparchives
6.2.2 Where do these codenames come from?
--------------------------------------------------------------------------------
"base-config" is the program that is run when you first booted into your debian
system... Run this again to re-configure debian.
--------------------------------------------------------------------------------
Pseudo TTY:
/dev/pts/0
The 0 terminal is generated as a login session is created. If another
session is created while 0 is present, a 1 session is then created.
Typing 'tty' will show your current session device.
In Unix, a pseudo terminal is a pseudo-device pair that provides a text
terminal interface without associated virtual console, computer terminal
or serial port hardware. Instead, a process replaces the role of the
underlying hardware for the pseudo terminal session.
The name of the TTY device comes from "teletypewriter", abbreviated "TTY".
--------------------------------------------------------------------------------
modules
/lib/modules/`uname -r`/
/lib/modules/2.4.27-2-386/kernel/drivers/
--------------------------------------------------------------------------------
Install SMP kernel:
apt-get install kernel-image-2.4.27-3-686-smp
--------------------------------------------------------------------------------
Search for Applications (e.g. ftp)
apt-cache search ftp-server
--------------------------------------------------------------------------------
Default X Session Manager
To change the default session manager I used:
update-alternatives --set x-session-manager
update-alternatives --set x-session-manager /usr/bin/startkde
~/.xsession
exec /usr/bin/startkde
--------------------------------------------------------------------------------
Changing Hostnames
To change the FQDN (fully qualified domain name) of a Debian linux server,
perform the following:
# echo “SERVER_FQDN” > /etc/hostname
The server’s hostname will be updated after a restart.
--------------------------------------------------------------------------------
~/.bash_profile
# the default umask is set in /etc/login.defs
#umask 022
--------------------------------------------------------------------------------
/etc/bash.bashrc
# System-wide .bashrc file for interactive bash(1) shells.
# To enable the settings / commands in this file for login shells as well,
# this file has to be sourced in /etc/profile.
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" -a -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
# enable bash completion in interactive shells
#if [ -f /etc/bash_completion ]; then
# . /etc/bash_completion
#fi
--------------------------------------------------------------------------------
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11"
else
PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games"
fi
if [ "$PS1" ]; then
if [ "$BASH" ]; then
PS1='\u@\h:\w\$ '
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
export PATH
umask 022
--------------------------------------------------------------------------------
/etc/init.d/bootmisc.sh
if [ "$EDITMOTD" != no ]
then
MOTD="`readlink -f /etc/motd || :`"
if [ "$MOTD" != "" ]
then
uname -a > $MOTD.tmp
sed 1d $MOTD >> $MOTD.tmp
mv $MOTD.tmp $MOTD
fi
fi
--------------------------------------------------------------------------------
Service management
To get a list of services that are configured to startup at run-level 2
(Debian’s default run-level), execute the following as root:
# ls –l /etc/rc2.d/S*
To add a service to the startup list, execute:
# update-rc.d service_name start 99 2 3 4 5 . stop 0 1 6 .
The above will start service_name as the last step of the startup service
in run-levels 2, 3, 4, and 5, and stop the service in run-levels 0, 1, and 6.
To stop a service from starting on bootup, execute:
# rm –rf /etc/rc2.d/S*service_name
*** you can also execute ‘update-rc.d –f service_name remove’ ***
To manually start or stop a service, execute the following as root:
# /etc/init.d/service_name [start|stop]
For more information regarding Debian’s service management options, execute
'man update-rc.d' from a shell.
--------------------------------------------------------------------------------
Get the most out of DNS with Wildcard DNS!
Do you want your users to get to your web site even if they mistype the URL?
Use wildcard DNS to allow Internet users to resolve your IP address no matter
what hostname they type.
Just use a "*" in the place of the host name in your DNS configuration (works
for BIND or Windows DNS)
*.YOUR-DOMAIN-HERE.com IN A 123.123.123.123
--------------------------------------------------------------------------------
How do I load a console font on startup the Debian way?
The kbd and console-tools packages support this, edit:
/etc/kbd/config or /etc/console-tools/config files.
--------------------------------------------------------------------------------
Debian Bootstrap
Like all Unices, Debian boots up by executing the program init. The
configuration file for init (which is /etc/inittab) specifies that the first
script to be executed should be /etc/init.d/rcS. This script runs all of the
scripts in /etc/rcS.d/ by sourcing or forking subprocess depending on their file
extension to perform initialization such as to check and to mount file systems,
to load modules, to start the network services, to set the clock, and to perform
other initialization. Then, for compatibility, it runs the files (except those
with a `.'in the filename) in /etc/rc.boot/ too. Any scripts in the latter
directory are usually reserved for system administrator use, and using them in
packages is deprecated.
After completing the boot process, init executes all start scripts in a directory
specified by the default runlevel (this runlevel is given by the entry for id in
/etc/inittab). Like most System V compatible Unices, Linux has 7 runlevels:
0 (halt the system),
1 (single-user mode),
2 through 5 (various multi-user modes), and
6 (reboot the system).
Debian systems come with id=2, which indicates that the default runlevel will
be '2' when the multi-user state is entered, and the scripts in /etc/rc2.d/
will be run.
In fact, the scripts in any of the directories, /etc/rcN.d/ are just symbolic
links back to scripts in /etc/init.d/. However, the names of the files in each
of the /etc/rcN.d/ directories are selected to indicate the way the scripts in
/etc/init.d/ will be run. Specifically, before entering any runlevel, all the
scripts beginning with 'K' are run; these scripts kill services. Then all the
scripts beginning with 'S' are run; these scripts start services. The two-digit
number following the 'K' or 'S' indicates the order in which the script is run.
Lower numbered scripts are executed first.
This approach works because the scripts in /etc/init.d/ all take an argument
which can be either `start', `stop', `reload', `restart' or `force-reload' and
will then do the task indicated by the argument. These scripts can be used even
after a system has been booted, to control various processes.
For example, with the argument `reload' the command
/etc/init.d/sendmail reload
sends the sendmail daemon a signal to reread its configuration file. (BTW,
Debian supplies invoke-rc.d as a wrapper for invoking the scripts in
/etc/init.d/.)
--------------------------------------------------------------------------------
It looks as if Debian does not use rc.local to customize the boot process; what
facilities are provided?
Suppose a system needs to execute script foo on start-up, or on entry to a
particular (System V) runlevel. Then the system administrator should:
Enter the script foo into the directory /etc/init.d/.
Run the Debian command update-rc.d with appropriate arguments, to set up links
between the (command-line-specified) directories rc?.d and /etc/init.d/foo.
Here, '?' is a number from 0 through 6 and corresponds to each of the System V
runlevels.
Reboot the system.
The command update-rc.d will set up links between files in the directories
rc?.d and the script in /etc/init.d/. Each link will begin with a 'S' or a 'K',
followed by a number, followed by the name of the script. Scripts beginning
with 'S' in /etc/rcN.d/ are executed when runlevel N is entered. Scripts
beginning with a 'K' are executed when leaving runlevel N.
One might, for example, cause the script foo to execute at boot-up, by putting
it in /etc/init.d/ and installing the links with update-rc.d foo defaults 19.
The argument 'defaults' refers to the default runlevels, which are 2 through 5.
The argument '19' ensures that foo is called before any scripts containing
numbers 20 or larger.
--------------------------------------------------------------------------------
How do I find out what program is listening on a specific TCP Port?
To find the PID (process ID) of the process responsible for listening on a port
(example queries the kernel for the process listening on port 22),
# fuser 22/tcp
22/tcp: 30010
All of the values to the right of '22/tcp' are PIDs that
- belong to processes spawned by the port in question, or
- belong to the process actually responsible for listening
--------------------------------------------------------------------------------
How do I change my server"s time?
An NTP (Network Time Protocol) server, which can be used to ensure the correct
time. To do so, a time zone must be defined. Find the desired time zone in
/usr/share/zoneinfo.
# rm -f /etc/localtime
# ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime
Once the time zone is set, to execute the following to sync the current time
with ServePath"s NTP server, install the ntp package (APT/RPM tutorials), and
executing:
# ntpdate time.nist.gov
# ntpdate ntp.servepath.com
will sync the local clock with an NTP server.