Difference between revisions of "NAD710 Lab 4 Answers"

From CDOT Wiki
Jump to: navigation, search
(Added steps for a simpler way to find modified files.)
 
(12 intermediate revisions by 3 users not shown)
Line 11: Line 11:
  
 
'''3. Which file stores the static hostname to IP address mapping ?'''
 
'''3. Which file stores the static hostname to IP address mapping ?'''
/etc/sysconfig/networking/profiles/default/hosts
 
  
How about:
+
Static mappings of hostnames to IP addresses are stored in the file '/etc/hosts'.
/etc/hosts
 
  
 
'''4. Which file stores the DNS servers IP addresses ?'''
 
'''4. Which file stores the DNS servers IP addresses ?'''
  /etc/sysconfig/networking/profiles/default/resolv.conf
+
   
 
+
DNS server IP addresses are stored in the file '/etc/resolv.conf'.
I think the file is:
 
/etc/resolv.conf
 
  
 
'''5. What information is stored in /etc/sysconfig/network file ?'''
 
'''5. What information is stored in /etc/sysconfig/network file ?'''
Line 32: Line 28:
  
 
----
 
----
CHALLENGER
+
Option #1: There is no need to use tar or xargs to accomplish this task. It can be performed in it's entirety by the 'find' command. Assuming you have used a command like shown in the answer for question #8 to find all files in /etc/ modified by a particular GUI change, you could modify the command to copy all the located files to your current directory using the following form:
 +
 
 +
find /etc/ -type f -cnewer ~/stamp --exec cp {} . \;
 +
 
 +
''- Katherine Masseau''
  
  
Line 43: Line 43:
 
* /proc/net/ip_tables_targets
 
* /proc/net/ip_tables_targets
 
* ''Milton Paiva''
 
* ''Milton Paiva''
 +
  
 
'''  b. system-config-printer'''
 
'''  b. system-config-printer'''
* list of files here
+
* /etc/cups
* your name here
+
* /etc/cups/ppd
 +
* /etc/cups/ppd/Printing_Protocol.ppd
 +
* /etc/cups/printers.conf.O
 +
* /etc/cups/classes.conf
 +
* /etc/cups/printers.conf
 +
* /etc/printcap
 +
* /dev/par0
 +
* /dev/.udev
 +
* /dev/.udev/names
 +
* /dev/.udev/names/lp0
 +
* /dev/.udev/names/lp0/\x2fclass\x2fprinter\x2flp0
 +
* /dev/.udev/names/par0
 +
* /dev/.udev/names/par0/\x2fclass\x2fprinter\x2flp0
 +
* /dev/.udev/names/parport0
 +
* /dev/.udev/names/parport0/\x2fclass\x2fppdev\x2fparport0
 +
* /dev/.udev/db
 +
* /dev/.udev/db/\x2fclass\x2fprinter\x2flp0
 +
* /dev/.udev/db/\x2fclass\x2fppdev\x2fparport0
 +
* /dev/.udev/uevent_seqnum
 +
* /dev/ptmx
 +
* /dev/pts/0
 +
'' - Patricia Constantino Sosa ''
  
 
'''  c. system-config-users'''
 
'''  c. system-config-users'''
Line 61: Line 83:
  
 
'''  e. system-config-services'''
 
'''  e. system-config-services'''
* list of files here
+
Enabling the Bluetooth service altered the following files:
 +
* /etc/rc.d/rc0.d: /etc/rc.d/rc0.d/K72ntpd, /etc/rc.d/rc0.d/K84wpa_supplicant, /etc/rc.d/rc0.d/K72setroubleshoot, /etc/rc.d/rc0.d/K74kerneloops, /etc/rc.d/rc0.d/K50bluetooth
 +
* /etc/rc.d/rc1.d: /etc/rc.d/rc1.d/K72ntpd, /etc/rc.d/rc1.d/K84wpa_supplicant, /etc/rc.d/rc1.d/K72setroubleshoot, /etc/rc.d/rc1.d/K74kerneloops, /etc/rc.d/rc1.d/K50bluetooth
 +
* /etc/rc.d/rc2.d: /etc/rc.d/rc2.d/K72ntpd, /etc/rc.d/rc2.d/S50bluetooth, /etc/rc.d/rc2.d/K84wpa_supplicant, /etc/rc.d/rc2.d/K72setroubleshoot, /etc/rc.d/rc2.d/K74kerneloops
 +
* /etc/rc.d/rc3.d: /etc/rc.d/rc3.d/K72ntpd, /etc/rc.d/rc3.d/S50bluetooth, /etc/rc.d/rc3.d/K84wpa_supplicant, /etc/rc.d/rc3.d/S90kerneloops, /etc/rc.d/rc3.d/S28setroubleshoot
 +
* /etc/rc.d/rc4.d: /etc/rc.d/rc4.d/K72ntpd, /etc/rc.d/rc4.d/S50bluetooth, /etc/rc.d/rc4.d/K84wpa_supplicant, /etc/rc.d/rc4.d/S90kerneloops, /etc/rc.d/rc4.d/S28setroubleshoot
 +
* /etc/rc.d/rc5.d: /etc/rc.d/rc5.d/K72ntpd, /etc/rc.d/rc5.d/S50bluetooth, /etc/rc.d/rc5.d/K84wpa_supplicant, /etc/rc.d/rc5.d/S90kerneloops, /etc/rc.d/rc5.d/S28setroubleshoot
 +
* /etc/rc.d/rc6.d: /etc/rc.d/rc6.d/K72ntpd, /etc/rc.d/rc6.d/K84wpa_supplicant, /etc/rc.d/rc6.d/K72setroubleshoot, /etc/rc.d/rc6.d/K74kerneloops, /etc/rc.d/rc6.d/K50bluetooth
 +
''- Katherine Masseau''.
 +
 
 +
 
 
* your name here
 
* your name here
  
Line 70: Line 102:
 
* Nestor the Master
 
* Nestor the Master
  
'''A simpler way to find the files modified by a change made in the system configuration GUI:'''
+
'''8. A simpler way to find the files modified by a change made in the system configuration GUI:'''
  
 
If you are trying to determine what files in the /etc/ directory were modified by a particular configuration change made in the GUI, the simplest method is the following:
 
If you are trying to determine what files in the /etc/ directory were modified by a particular configuration change made in the GUI, the simplest method is the following:
Line 76: Line 108:
 
1. Before you make the alteration to the GUI settings, run the following command in your shell of choice:
 
1. Before you make the alteration to the GUI settings, run the following command in your shell of choice:
  
  'touch ~/timestamp'
+
  touch ~/timestamp
  
 
This command creates an empty file in your home directory named timestamp. We don't need to put anything in this file - the only important part is the modification time.
 
This command creates an empty file in your home directory named timestamp. We don't need to put anything in this file - the only important part is the modification time.
Line 84: Line 116:
 
3. Now, return to your shell of choice and run the following command:
 
3. Now, return to your shell of choice and run the following command:
  
  'find /etc/ -cnewer ~/timestamp'
+
  find /etc/ -cnewer ~/timestamp
  
 
This command will return a list of files in the /etc/ directory that have been modified more recently than the file '~/timestamp', making it much easier than attempting to calculate the correct time by hand using the other time related switches for the find command.
 
This command will return a list of files in the /etc/ directory that have been modified more recently than the file '~/timestamp', making it much easier than attempting to calculate the correct time by hand using the other time related switches for the find command.
  
''- Gregory Masseau''
+
''- Katherine Masseau''
 +
 
 +
'''system-config-firewall'''
 +
*/etc/sysconfig/iptables
 +
*/etc/sysconfig/iptables-config
 +
*/etc/sysconfig/ip6tables-config
 +
*/etc/sysconfig/ip6tables
 +
''- Varinder Singh''

Latest revision as of 23:38, 16 July 2012

Questions

1. Which file stores the computer's host name?

/etc/sysconfig/network

2. Which file stores the static IP addresses ?

/etc/sysconfig/networking/devices/ifcfg-eth1

In my opinion the file is:

/etc/sysconfig/network-scripts/ifcfg-eth0

3. Which file stores the static hostname to IP address mapping ?

Static mappings of hostnames to IP addresses are stored in the file '/etc/hosts'.

4. Which file stores the DNS servers IP addresses ?

DNS server IP addresses are stored in the file '/etc/resolv.conf'.

5. What information is stored in /etc/sysconfig/network file ?

This file stores information like computer's hostname and default gateway.
This file looks like

NETWORKING=yes
HOSTNAME=mohak

6. Would you be able to construct a single pipe line command using "find", "xargs", and "tar" to copy all the files (with the same directory structure) found by the "find" command to the currect directory ?


Option #1: There is no need to use tar or xargs to accomplish this task. It can be performed in it's entirety by the 'find' command. Assuming you have used a command like shown in the answer for question #8 to find all files in /etc/ modified by a particular GUI change, you could modify the command to copy all the located files to your current directory using the following form:

find /etc/ -type f -cnewer ~/stamp --exec cp {} . \;

- Katherine Masseau


7. Pick one of the following system configuration program and determine what files are being used to store the configure parameters:

a. system-config-firewall

  • /etc/sysconfig/iptables
  • /proc/net/ip_tables_matches
  • /proc/net/ip_tables_names
  • /proc/net/ip_tables_targets
  • Milton Paiva


b. system-config-printer

  • /etc/cups
  • /etc/cups/ppd
  • /etc/cups/ppd/Printing_Protocol.ppd
  • /etc/cups/printers.conf.O
  • /etc/cups/classes.conf
  • /etc/cups/printers.conf
  • /etc/printcap
  • /dev/par0
  • /dev/.udev
  • /dev/.udev/names
  • /dev/.udev/names/lp0
  • /dev/.udev/names/lp0/\x2fclass\x2fprinter\x2flp0
  • /dev/.udev/names/par0
  • /dev/.udev/names/par0/\x2fclass\x2fprinter\x2flp0
  • /dev/.udev/names/parport0
  • /dev/.udev/names/parport0/\x2fclass\x2fppdev\x2fparport0
  • /dev/.udev/db
  • /dev/.udev/db/\x2fclass\x2fprinter\x2flp0
  • /dev/.udev/db/\x2fclass\x2fppdev\x2fparport0
  • /dev/.udev/uevent_seqnum
  • /dev/ptmx
  • /dev/pts/0

- Patricia Constantino Sosa

c. system-config-users

  • /etc/group- >>> Saves new users and UID's in this file.
  • /etc/sysconfig/system-config-users >>> Each time you open this utility, this file gets edited.
  • /etc/passwd >>> This file stores the users, UID's, users home directory and users login shell
  • /etc/gshadow >>> This file stores a new group created.
  • Mohak Vyas

d. system-config-display

  • /etc/X11/xorg.conf
  • /etc/X11/xorg.conf.backup
  • Nestor the Player

e. system-config-services Enabling the Bluetooth service altered the following files:

  • /etc/rc.d/rc0.d: /etc/rc.d/rc0.d/K72ntpd, /etc/rc.d/rc0.d/K84wpa_supplicant, /etc/rc.d/rc0.d/K72setroubleshoot, /etc/rc.d/rc0.d/K74kerneloops, /etc/rc.d/rc0.d/K50bluetooth
  • /etc/rc.d/rc1.d: /etc/rc.d/rc1.d/K72ntpd, /etc/rc.d/rc1.d/K84wpa_supplicant, /etc/rc.d/rc1.d/K72setroubleshoot, /etc/rc.d/rc1.d/K74kerneloops, /etc/rc.d/rc1.d/K50bluetooth
  • /etc/rc.d/rc2.d: /etc/rc.d/rc2.d/K72ntpd, /etc/rc.d/rc2.d/S50bluetooth, /etc/rc.d/rc2.d/K84wpa_supplicant, /etc/rc.d/rc2.d/K72setroubleshoot, /etc/rc.d/rc2.d/K74kerneloops
  • /etc/rc.d/rc3.d: /etc/rc.d/rc3.d/K72ntpd, /etc/rc.d/rc3.d/S50bluetooth, /etc/rc.d/rc3.d/K84wpa_supplicant, /etc/rc.d/rc3.d/S90kerneloops, /etc/rc.d/rc3.d/S28setroubleshoot
  • /etc/rc.d/rc4.d: /etc/rc.d/rc4.d/K72ntpd, /etc/rc.d/rc4.d/S50bluetooth, /etc/rc.d/rc4.d/K84wpa_supplicant, /etc/rc.d/rc4.d/S90kerneloops, /etc/rc.d/rc4.d/S28setroubleshoot
  • /etc/rc.d/rc5.d: /etc/rc.d/rc5.d/K72ntpd, /etc/rc.d/rc5.d/S50bluetooth, /etc/rc.d/rc5.d/K84wpa_supplicant, /etc/rc.d/rc5.d/S90kerneloops, /etc/rc.d/rc5.d/S28setroubleshoot
  • /etc/rc.d/rc6.d: /etc/rc.d/rc6.d/K72ntpd, /etc/rc.d/rc6.d/K84wpa_supplicant, /etc/rc.d/rc6.d/K72setroubleshoot, /etc/rc.d/rc6.d/K74kerneloops, /etc/rc.d/rc6.d/K50bluetooth

- Katherine Masseau.


  • your name here

8. How can I get the lasts modified files in the system using find command ?

  • find /etc -mmin -2 --> This will let u see all files in /etc that were modified in last 2 minutes.
  • find /etc -cmin -2 --> This will let u see all files in /etc that were changed in last 2 minutes.
  • Nestor the Master

8. A simpler way to find the files modified by a change made in the system configuration GUI:

If you are trying to determine what files in the /etc/ directory were modified by a particular configuration change made in the GUI, the simplest method is the following:

1. Before you make the alteration to the GUI settings, run the following command in your shell of choice:

touch ~/timestamp

This command creates an empty file in your home directory named timestamp. We don't need to put anything in this file - the only important part is the modification time.

2. Make the configuration alteration that interests you in the GUI.

3. Now, return to your shell of choice and run the following command:

find /etc/ -cnewer ~/timestamp

This command will return a list of files in the /etc/ directory that have been modified more recently than the file '~/timestamp', making it much easier than attempting to calculate the correct time by hand using the other time related switches for the find command.

- Katherine Masseau

system-config-firewall

  • /etc/sysconfig/iptables
  • /etc/sysconfig/iptables-config
  • /etc/sysconfig/ip6tables-config
  • /etc/sysconfig/ip6tables

- Varinder Singh