unix-admin-tips-and-tricks - some tips and tricks for administering unix systems * Introduction This document gives some tips and tricks for administering Unix and GNU/Linux systems, including hints on how to deal with network settings on Debian systems. * Debian network settings Per interface settings (wether or not use dhcp, what IP address to use): /etc/network/interfaces When changing IP address, be sure to update uruk iptables rules too, as well as (probably) /etc/hosts. The files /etc/resolv.conf , /etc/nsswitch.conf and /etc/hosts.conf might need a look too. * Linux kernel hardware support Check Hardware-HOWTO.gz (the Linux Hardware Compatibility HOWTO) before buying. If your hardware is not recognized immediately, grep /usr/share/doc/kernel-doc-2.4.24/Documentation/Configure.help.gz and find the name of the needed kernel module. This modules should be present in /lib/modules// . If it's there, load it by doing # modprobe . * Printing Use CUPS, or Samba. * Backups If your system does not contain big datafiles, and it's adhering to the File Hierarchy standard (like Debian GNU/Linux is), you're generally save if you backup just /etc/ : all configuration files are there. The rest of the system could get reinstalled from trusted media in case of disasters. If you'd like to backup more, you might want to take a look at /usr/local , /home and /var . * Cronjobs Systems using the Debian cron package, store cronjobs in /etc/cron.*/ and /var/spool/cron/crontabs/ . Other Linux distro's and Unices likely have subtly different setups: Vixie cron was forked. * Network debugging ** nmap which hosts are up? nmap -sP 196.21.220.0/24 What services is my system providing to client machine? user@client ~$ nmap mysystem root@client ~$ nmap -sU mysystem ** tcpdump See all network packets root@myhost ~$ tcpdump -n -ieth0 tcp port ssh and host 10.0.1.2 See also ettercap, tethereal. ** other helpful commands traceroute, route, ifconfig, netstat -a * System debugging ** strace See systemcalls: strace ** lsof List open files and network connections of local process: lsof -p When no option is given, lsof prints open files for all processes for which this information is available. Generally, lsof needs to be run as root. ** strings See ascii data in binary file (e.g. version number or name of default configuration file used) strings /usr/bin/ ** gdb FIXME * Daily Admin jobs ** Adding and removing a useraccount # adduser chatty For special needs, do e.g. # adduser --disabled-password --shell /usr/bin/zsh uvt . Removing: # deluser --remove-home joostvb See adduser(8), deluser(8). Some systems don't have the adduser package installed, and offer useradd(8) only. On some systems, using vipw(8) is more convenient. * Version, availability This is version $Id: unix-admin-tips-and-tricks.txt 11061 2006-08-25 08:10:50Z joostvb $ of $URL: https://infix.uvt.nl/its-id/trunk/sources/uvt-unix-doc/unix-admin-tips-and-tricks.txt $. This document is published on http://www.non-gnu.uvt.nl/pub/uvt-unix-doc/ . * See also Enrico Zini wrote a similar document, when he visited Addis in Etiopia. Get it from http://www.enricozini.org/blog/tags/tips. Roland van Hout wrote a similar document, when he visited NUR in Rwanda. Get it from https://rvhout.net/rwanda/course_adv_unx_adm.html. * Copyright Copyright (C) 2004 Joost van Baal, Copyright (C) 2004, 2005, 2006 Tilburg University http://www.uvt.nl/. This document is free; you can redistribute it and/or modify it under the terms of the GNU GPL, see http://www.gnu.org/copyleft/gpl.html. There is NO WARRANTY.