Notitzen Linux-Lehrgang 5102
Peepen ausschalten:
setterm -blength 0
Netzwerk Einstellungen ändern
Temporär:
ifconfig eth0 192.168.0.74 netmask 255.255.255.192 broadcast 192.168.0.127 up
weitere Adressen (bis zu 256)
ifconfig eth0:1 192.168.0.74 netmask 255.255.255.192 broadcast 192.168.0.127 up
ifconfig eth0:1 down
Zweite Adresse auf Hostsystem
ifconfig eth0:1 192.168.2.254 netmask 255.255.255.0 broadcast 192.168.2.255 up
/etc/init.d/networking/ stop
/etc/init.d/networking/ start
Debian fest einstellen: in /etc/network/interfaces
auto eth0 iface eth0 inet static address 192.168.0.89 netmastk 255.255.255.192 brodcast 192.168.0.127 #optional up route add default gw 192.168.0.126 down route del default gw 192.168.0.126 up echo 1 > /proc/sys/net/ipv4/ip_forward down echo 0 > /proc/sys/net/ipv4/ip_forward
/etc/init.d/networking stop
/etc/init.d/networking start
down echo 0 > /proc/sys/net/ipv4/ip_forward
SUSE fest einstellen:
/etc/sysconfig/network/ifcfg-eth0
BOOTPROTO='static' STARTMODE='onboot' IPADDR='10.2.3.210/24' # NETMASK='255.25.255.0' (optional) # PREFIXLEN='24' (optional)
Wenn STARTMODE=''dann wird die Karte aus manuell gesetzt und nicht automatisch hochgefahren
Gateway in /etc/sysconfig/network/routes einstellen
# Ziel Gateway Maske Karte default 192.168.3.202 - -
rcnetwork restart oder /etc/init.d/network restart
Befehl IP
ip link show (Überblick)
ip link show dev eth0
ip link set dev eth0 up (Schnittstelle hochfahren)
ip link set dev eth0 down (Schnittstelle runterfahren)
ip addr add 192.168.2.125/26 brd 192.168.2.127 dev eth0 label eth0:2
ip addr del 192.168.2.125/26 brd 192.168.2.127 dev eth0:2
ip route add default via 192.168.0.126 dev eth0
ip route del default via 192.168.0.126 dev eth0
Router auf Debian: in /etc/network/interfaces
auto eth0 iface eth0 inet static address 10.2.3.110 netmastk 255.255.255.0 brodcast 10.2.3.255 up route add default gw 10.2.3.1 up echo 1 > /proc/sys/net/ipv4/ip_forward down route add default gw 10.2.3.1 up echo 0 > /proc/sys/net/ipv4/ip_forward auto eth1 iface eth1 inet static address 12.0.0.10 netmastk 255.255.255.0 brodcast 12.0.0.255
Kommentare raus filtern
sed -ne '^[^#]/p' /etc/dhcpd.conf
echo $PATH | tee path.dat
Schritte der Shell:
- Variable expandieren (auflösen, durch Wert/ Inhalt ersetzen)
- PIPE erkennen
- Kmd echo ausgeführt
- Ausgabe in die PIPE geschrieben
- Datei path.dat wird geöffnet/erstellt
- PIPE ausgelesen von tee
- Ausgabe an stdout » Monitor
- Ausgabe in die Datei
- Datei schließen
- Komandozeile fertig
VMWARE
DHCP ausschalten
/etc/init.d/vmware stop
Einträge in /etc/vmware/vmnet2/dhcpd/dhcpd.conf auskomentieren, oder Datei leeren
VI
Zeilen auskommentieren
:1,$s/^/### /
Ergebnis z.B.
### #
### # Configuration file for ISC 2.0b6pl1 vmnet-dhcpd operating on vmnet2.
### #
### # This file was automatically generated by the VMware configuration program.
### # If you modify it, it will be backed up the next time you run the
### # configuration program.
### #
### # We set domain-name-servers to make some DHCP clients happy
### # (dhclient as configued in SuSE, TurboLinux, etc.).
### # We also supply a domain name to make pump (Red Hat 6.x) happy.
### #
### allow unknown-clients;
### default-lease-time 1800; # 30 minutes
### max-lease-time 7200; # 2 hours
###
### subnet 192.168.2.0 netmask 255.255.255.0 {
### range 192.168.2.128 192.168.2.254;
### option broadcast-address 192.168.2.255;
### option domain-name-servers 192.168.2.1;
### option domain-name "localdomain";
###
### }
Zeilen ändern
:1,$s/localhost/lenny.kit-koblenz.de/g
ersetzt localhost durch lenny.kit-koblenz.de
durch g ersetze auch mehrfach vorkommen in den Zeilen
Windows
auf dhcp einstellen
netsh interface ip set address „LAN-Verbindung“ dhcp
DNS
- Installation BIND9
- Konfiguration
/etc/bind/named.conf
///etc/bind/named.conf.option//\\ ///etc/bind/named.conf.local//\\ - named-checkconf - Anlegen der Namenszone
/etc/resolver.conf
search kit-koblenz.de kit-dresden.de nameserver 192.168.2.201
FTP
Befehle: be bell Bell mode ha hash Hashmode by bey Abmelden
VSFTPD über INETD /etc/vsftpd.conf listen=NO listen_ipv6=NO
chekconfig -del vsftpd (SUSE) update-rc.d -f vsftpd
vsftpd daemon beenden
/etc/services evtl anpassen ftp 21/tcp oder vsftpd1 100021/tcp #VSFTP
/etc/inetd.conf
vsftpd stream tcp nowait root /usr/sbin/vsftpd vsftpd (Name aus /etc/services, ,Protokol, mehere Vebindungen möglich, läuft unter root, Path, Name) vsftpd stream tcp nowait root /usr/sbin/TCPD vsftpd
inetd starten mit inetd
killall -1 inetd
prüfen mit netstat
netstat -t = tcp
netstat -ta = tcp alle
netstat -tan = tcp alle numerisch
ftp localhost 10021 oder ftp://localhost:10021
xinetd
# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/
defaults
{
# Please note that you need a log_type line to be able to use log_on_success
# and log_on_failure. The default is the following :
# log_type = SYSLOG daemon info
includedir /etc/xinetd.d
log_type = FILE /var/log/xinetd.log
# log_type = SYSLOG local2 info
log_on_success = HOST EXIT DURATION
log_on_failure = HOST USERID ATTEMPT
instances = 2
}
service vsftpd2
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/sbin/vsftpd
# only_from = 192.168.2.201
# no_access = 192.168.2.0/24
}
q
NTPD
watch -n 1 ntpq -p
SAMBA
[global] workgroup = SCHULUNG netbios name = SAMBA03 domain master = yes local master = yes browse list = yes preferred master = yes wins server = 192.168.2.204 wins proxy = yes security = USER name resolve order = host wins bcast dns proxy = no log file = /var/log/samba/log.%m max log size = 1000 syslog = 0 panic action = /usr/share/samba/panic-action %d encrypt passwords = true passdb backend = tdbsam obey pam restrictions = yes unix password sync = yes passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . pam password change = yes [homes] comment = Home Directories browseable = no read only = No create mask = 0700 directory mask = 0700 valid users = %S [printers] comment = All Printers browseable = no path = /var/spool/samba printable = yes guest ok = no read only = yes create mask = 0700 [print$] comment = Printer Drivers path = /var/lib/samba/printers browseable = yes read only = yes guest ok = no [UEBUNGEN] path = /home/SAMBA/UEBUNGEN comment = Freigabe fuer alle Benutzer browsable = yes ; read only = No writeable = yes guest ok = yes [schulung] path = /home/SAMBA/schulung comment = Freigabe fuer Gruppen schulung browsable = yes writeable = No guest ok = No write list = @root @schulung [kurs] path = /home/SAMBA/kurs comment = Freigabe fuer Gruppe kurs browsable = No read only = Yes write list = @kurs admin users = me
Squid
- Routing
- Caching
- ACLs
- Logging
- loadblancing
/etc/squid/squid.conf
/etc/init.d/squid [start, stop, reload, status]
squid -z (cach initialisieren)
mit chkconfig in runlevel eintragen
an boot manager prompt „init /bin/bash“ um root zu werden Abhilfe in /boot/grub/munu.lst ein passwort vergeben
APACHE
Pakete
apache2
apache2-worker (Threds) oder
apache2-prefork (Kindprozesse)
apache2-doc
apache2-examble_page
apache2-mod_php5
/srv/www/htdocs start /etc/init.d/apache2 apache2ctl (Controlsrkipt) /etc/apache2/httpd.conf
jfs Dateisystem für schnellen Zugriff auf kleine Dateien
