Navigation Links Back to top

Set Hostname Entry

Keep in mind we are trying to imitate a real-world scenario to demonstrate fundamental security concepts. In a production environment we'd be using DNS.

Instructions to add hostname to /etc/hosts on target machine

If SSL connectivity is to occur between a client and server residing on separate machines, the public key's common name must match the hostname set here.
  1. Determine IP address of target machine:
                

    # /sbin/ifconfig

    Example output contains 192.168.1.101:
                

    eth0 Link encap:Ethernet HWaddr 00:0c:29:43:94:0c inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe43:940c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:408641 errors:0 dropped:0 overruns:0 frame:0 TX packets:134769 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:458268505 (458.2 MB) TX bytes:28361917 (28.3 MB)

  2. Add new hostname entry using current IP address:

    1. Edit the hosts file
                  

      # sudo vi /etc/hosts

    2. Use your IP address for new host entry:
                  

      192.168.1.101 fortressdemo2.com

    3. Save and exit

  3. Ping hostname:
                

    # ping fortressdemo2.com

    Verify results:
                

    PING fortressdemo2.com (192.168.1.101) 56(84) bytes of data. 64 bytes from fortressdemo2.com (192.168.1.101): icmp_req=1 ttl=64 time=0.106 ms 64 bytes from fortressdemo2.com (192.168.1.101): icmp_req=2 ttl=64 time=0.052 ms 64 bytes from fortressdemo2.com (192.168.1.101): icmp_req=3 ttl=64 time=0.055 ms 64 bytes from fortressdemo2.com (192.168.1.101): icmp_req=4 ttl=64 time=0.068 ms

This is free and unencumbered software released into the public domain.