CSCI 57 and 65: Introduction to Unix Courses
Laboratory Assignment 10
1. TURN-IN a hard copy of the following:
- On all homework please include
- Your Name
- Course Number
- Date
- ecst login name
- The preferred format for
homework for the rest of the semester (unless otherwise specified) is
to just print it out the lab webpage and write your answers on the
printout.
- If you are really into typing I will still take it typed.
- You do NOT need to include the printing cover page (details given in lab).
- You do NOT need to print from Unix.
- Do this lab on tiglon (otherwise you will get wrong answers)
- Please answer the following questions (answers and/or help given in lab).
Things to do on tiglon (ect-unix.ecst.csuchico.edu)
- hostname
- The hostname command will tell you the name of the host you are one.
- What host are you on (it better be tiglon)? _____________________________________
- Make sure you do all of this assignment on tiglon.
- ping
- ping sends a small packet to a server which the server then sends back.
- ping lets you test things like if a host is alive.
- Typing ping www.google.com should respond with a message like "www.google.com is alive"
- Now try typing ping -s www.google.com (Type <Ctrl>-c to exit).
- The "-s" option gives you statistics.
- How many milliseconds does it take to ping www.google.com from tiglon?
- min________________________
- max________________________
- average_____________________
- How many packets were transmitted?______________________________
- How many packets were recieved?_________________________________
- (After typing <Ctrl>-c you will see ping statistics)
- Now try ping -s 132.241.82.24
- How many milliseconds does it take to ping 132.241.82.24 from tiglon?
- min________________________
- max________________________
- average_____________________
- What is the human readable host name of 132.241.82.24?__________________________________________
- nslookup (on Linux nslookup is being replaced in favor of similar commands such as host and dig, tiglon doesn't have these commands though).
- nslookup is for looking up hostnames corresponding to ip addresses and vice versa
- There are two parts to the output
- The nameserver that responded, hostname and ip
- The hostname and ip address(es) of the host you wanted to lookup
- Try nslookup www.hotmail.com
- What is the name of the server that answered you?_________________________________________________
- What are the IP addresses of www.hotmail.com?___________________________________________________
___________________________________________________________________________________________
- Try nslookup www.csuchico.edu
- What is the name of the server?____________________________________________________
- What is the ip address?___________________________________________________________
- What is the alias name?___________________________________________________________
- What is the IP address of steriod (steriod is one of the schools Unix servers in case you didn't know)?
- ______________________________________________________________________________
- Try nslookup 132.241.6.15 to find out the domain name for this address
- What is the domain name?________________________________________________________
- What is the alias name? __________________________________________________________
- ifconfig
- ifconfig is for configuring and finding out information about network interfaces.
- Type ifconfig -a to see information about all of tiglon's network interfaces
- Tiglon's ethernet card is called hme0 (on Linux this would be called eth0)
- What is the IP address of hme0?____________________________________
- What is the netmask?_____________________________________________
- What is the broadcast address?______________________________________
- The loopback interface has the IP address 127.0.0.1
- What is loopback interface name (like hme0 except something else)?_______________________
- traceroute
- traceroute displays the route between your computer and another
- Try traceroute www.whitehouse.gov
- How many computers/routers are between tiglon and www.whitehouse.gov?______________________
- Try traceroute www.shocking.com
- How many computers/routers are between tiglon and www.shocking.com?________________________
- Try traceroute www.csuchico.edu
- How many computers/routers are between tiglon and www.csuchico.edu?________________________
- Try traceroute www.sunset.net
- How many computers/routers are between tiglon and www.sunset.net?___________________________
- whois
- whois lets you query the whois database to find out who different domains are registered to.
- Try whois google.com
- This gave me three results (you will have to scroll up to find these results)
- GOOGLE.COM.SUCKS.FIND.CRACKZ.WITH.SEARCH.GULLI.COM
- GOOGLE.COM.HAS.LESS.FREE.PORN.IN.ITS.SEARCH.ENGINE.THAN.SECZY.COM
- GOOGLE.COM
- (One result is actually google and the others are some other funky domains, ignore them).
- To find out information about google.com type whois =google.com (look near the top of the output)
- Who is the registrar for google.com?_______________________________________________
- What is the name server(s) for google.com?_________________________________________
_____________________________________________________________________________ - When was the creation date for google.com?_________________________________________
- What is the expiration date for google.com?_________________________________________
- Try whois csuchico.edu
- Who is the registrar for csuchico.edu?___________________________________________________
- When was the creation date for csuchico.edu?_____________________________________________
- When was it last updated?_____________________________________________________________
- /etc/services
- This file contains a list of network services and which port they are on
- The format of this file is "service-name port-number/protocol aliases"
- Look at this file to find what port the following services listen on
- ftp?__________________________
- telnet?________________________
- smtp?_________________________
- finger?________________________
- finger
- finger lets you find out information about a user on a particular host.
- finger requires a finger service to be running on the target machine to provide information.
- This service isn't used very much any more.
- (any service is a potential security hole so people don't run things they don't need).
- Try finger lisonbee@freeshell.org
- On my freeshell acount
- Give the full path to my default shell ( /usr/something/something/bash )?__________________________________________
- What is the secret phrase in my .plan file?_____________________________________________
- who
- who tells you who is on the system
- run who on tiglon to see who is on the system
- What is in the column to the furthest right?_________________________________________________
- w
- w is a command similar to who except w also tells you what command a user is running
- What information does the third column provide?_________________________________________________
- What information does the right most column provide?____________________________________________
- ftp
- I am sure everyone is familar with ftp, most people don't know how to use it at the command line though.
- Type ftp to begin
- This will give you a prompt like ftp>
- Type help to see a list of available commands.
- Type open ftp.kernel.org to connect to a server.
- Login with username "anonymous" and use your email address as a password ( "me@email.com" ).
- Use ls to list files
- Change to the pub directory ( type "cd pub" ).
- Type ls to list the files.
- Download the README file ( type "get README" ).
- Now type quit to exit
- You have downloaded the README file, read it and find an email address for "comments on this site"
- What is the email address?___________________________________________________________
- Start ftp again, type ftp
- Type help to see a list of available commands, find out about a specific commnand by typing help <command name>
- What is put for?_______________________________________________________________
- What is mget for?______________________________________________________________
- What is lcd for?________________________________________________________________
- What is pwd for?_______________________________________________________________
- What is ascii for?_______________________________________________________________
- What is binary for?_____________________________________________________________
- Note that commands are similar for sftp (secure ftp).
- lynx
- lynx is a text only browser that you can run inside a terminal
- Text only browsers can be useful when you don't have X, otherwise they pretty much suck.
- Run lynx by typing lynx
- This will bring you the homepage for lynx
- Go to google by typing "g" and then "http://www.google.com"
- After being prompted if you want to accept cookies you should see google's homepage ( a little different than normal).
- Use the up and down arrows to switch between links and the "right arrow" or "enter" to follow a link.
- What key do you type in lynx for
- help?_________________________________________________________
- options?______________________________________________________
- /etc/resolv.conf
- resolv.conf contains a list of name servers for to consult for name resolution
- View /etc/resolv.conf
- How many name servers are listed?________________________________________________________
- What is the IP address of the first name server listed?__________________________________________
- /etc/hosts
- This file contains static host information. There is always at least one entry in this file.
- There are three name servers listed here on tiglon, what are their names? (hint: under DNS/NIS)
- _____________________________________________________________________________________
- _____________________________________________________________________________________
- _____________________________________________________________________________________
- What is the address for localhost?______________________________________________________________
- /etc/nsswitch.conf
- Gives the order of consultation for when doing lookups
- View this file and find the "hosts" entry.
- An entry such as "hosts: dns files" means the system will try a DNS server and then /etc/hosts to find an IP address
- An entry such as "hosts: files dns" means the system will try /etc/hosts and then DNS to find an IP address
- Which order is it on tiglon?______________________________________________________________