Göm menyn

TDDI41 Grundläggande systemadministration

Ht1-Ht2 2021


Lectures

  • Introduction TDP031
  • Lecture 2 Networking
  • Lecture 3- Directory Services (NIS/NIS+,LDAP,DNS)
  • BIND and Storage
  • Lecture 4 - Configuration Mangement
  • Network revisted

    Router settings:

    	      echo 1 > /proc/sys/net/ipv4/ip_forward
    	      iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE 

    Setting ip-address example (/etc/network/interfaces)
    	      auto lo eth0
    	      iface lo inet loopback
    
    	      iface eth0 inet static
    	        address 192.168.100.2
    	        netmask 255.255.255.240
    	        gateway 192.168.100.1
    
    	    
  • SSH tips
    • Passwordless login
                    #Generate key(s) (on the machine you want to ssh from)
                    router%>ssh-keygen
                    #copy pulic keys to the machines you want to ssh to
                    router%>ssh-copy-id -i ~/.ssh/id_rsa.pub root@machine
                  
    • SSH Jumphost
                    #You can connect to a target machine (server,client1/2) by using your router as a Jumphost
                    ida%>ssh -J root@127.0.0.1:2220 root@192.168.1.2
                    #To be able to do this without using password you need to
                    #copy your public-key from your IDA-folder to all your machines.
                  
    • SSH config
                      #
                    
  • DNS basics

    named.conf.local

    
    zone "anders.rune.com" {
    	type master;
    	file "/etc/bind/zones/anders.rune.com";
    };
    
    zone "100.168.192.in-addr.arpa" {
    	type master;
    	file "/etc/bind/zones/reverse/rev.100.168.192";
    };
    

    anders.rune.com

    root@uml-root-jessie:~# cat /etc/bind/zones/anders.rune.com
    $TTL 1h
    @ 	IN	SOA ns1.anders.rune.com. andla.anders.rune.com.(
    		201811223 ; SERIAL
    		2h	  ; Refresh
    		1h	  ; Retry
    		1w	  ; Expire
    		1h	) ;Minium
    
    ;
    @	IN 	NS 	ns1.anders.rune.com.
    @	IN 	NS 	ns2.anders.rune.com.
    
    anders.rune.com. IN 	A 	192.168.100.2
    ns1		 IN 	A	192.168.100.2
    ns2		 IN	A	192.168.100.2
    server		 IN	CNAME	anders.rune.com.
    client1		 IN	A	192.168.100.11
    client2		 IN	A	192.168.100.12
    
    lars.anders.rune.com. IN NS	ns1.lars.anders.rune.com.
    ns1.lars.anders.rune.com. A 192.168.100.20
    

Sidansvarig: Anders Fröberg
Senast uppdaterad: 2022-09-28