NAD710 Lab

 

 

NAD710 Lab 7


Samba Lab Report

 

 

Install Samba and related packages

#yum install samba

 

Installing:

 samba                   i386       3.2.4-0.21.fc9   updates-newkey    3.9 M

Updating:

 samba-client            i386       3.2.4-0.21.fc9   updates-newkey    9.3 M

 samba-common            i386       3.2.4-0.21.fc9   updates-newkey     11 M

 samba-winbind           i386       3.2.4-0.21.fc9   updates-newkey    2.9 M

Installing for dependencies:

 perl-Convert-ASN1       noarch     0.21-3.fc9       fedora             42 k

 

From the above list, we can see besides the samba package needs to be installed, samba-client, samba-common and samba-winbind need to be installed too.

 

#yum install samba-swat

 

Installing:

 samba-swat              i386       3.2.4-0.21.fc9   updates-newkey    8.8 M

Installing for dependencies:

 xinetd                  i386       2:2.3.14-20.fc9  updates-newkey    125 k

 

Check and start SWAT and xinetd service

# chkconfig –list xinetd

xinetd              0:off    1:off    2:off    3:on     4:on     5:on     6:off

 

# chkconfig –list swat

swat                 off

 

# chkconfig swat on

# chkconfig –list swat

swat                 on

 

# service xinetd status

xinetd is stopped

 

# service xinetd start

Starting xinetd:                                           [  OK  ]

 

# service xinetd status

xinetd (pid 2978) is running…

 

Use SWAT to configure share-level directory and test

Input http://localhost:901 in the web browser address. It will be display the below form. We can use it to configure and test.

 

smb1

 

Firstly, click the GLOBALS button, after list related items select security to SHARE and click the Commit Changes button.

Secondly, click the SHARES button, after list related items set the attributes as below.

          comment –> Document Share

          path –> /usr/share/doc

          guest ok –> Yes

          available –> Yes

Thirdly, click the VIEW button to check the changes.

[global]

            workgroup = MYGROUP

            server string = Samba Server Version %v

            security = SHARE

            log file = /var/log/samba/log.%m

            max log size = 50

            ldap ssl = no

            cups options = raw

 

[docs]

            comment = Document Share

            path = /usr/share/doc

            guest ok = Yes

 

Last but not least, click the STATUS to restart smbd, nmbd and winbindd service.

 

Now, let’s begin to test. Notice the red part.

[root@localhost ~]# smbclient -L localhost -N

Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.2.4-0.21.fc9]

 

            Sharename       Type      Comment

            ———       —-      ——-

            docs            Disk      Document Share

            IPC$            IPC       IPC Service (Samba Server Version 3.2.4-0.21.fc9)

Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.2.4-0.21.fc9]

 

            Server               Comment

            ———            ——-

            LOCALHOST            Samba Server Version 3.2.4-0.21.fc9

 

            Workgroup            Master

            ———            ——-

            MYGROUP              LOCALHOST

 

[root@localhost ~]# smbclient //localhost/docs -U%

Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.2.4-0.21.fc9]

Server not using user level security and no password supplied.

smb: \>

 

In the “smb:\>” prompt, we can input “ls” command to check the content of the directory “/usr/share/doc”. Input “quit” to exit.

 

Another test method is using Windows system to test. In a Windows machine,  right click “Start” button, click “Explore”. In Network Neighbour, click “docs” folder, we can find the contents of the shared directory “/usr/share/doc”.  

 

 smb2

 

Use SWAT to configure user-level directory and test

 

Firstly, make a user named “steven”, and add it the smb-password. Make the “/tmp/testshare” to share.

#useradd steven

#smbpasswd –a steven

#mkdir /tmp/testshare

#chmod 755 /tmp/testshare

 

Secondly, click the GLOBALS button in the SWAT browser, and set attributes as below.

          security –> USER

          encrypt passwords –> Yes

passdb backend –> smbpasswd

 

Thirdly, click the SHARES button, and set attributes as below.

          comment –> User Steven Share

          path –> /tmp/testshare

          read only –> No

          guest ok –> No

          available –> Yes

 

Fourthly, click the VIEW button, the below will be found.

[steven]

            comment = User Steven Share

            path = /tmp/testshare

            read only = No

 

Finally, click the STATUS to restart smbd, nmbd and winbindd service.

 

Now, let’s begin to test. Notice the red part.

[root@localhost ~]# smbclient -L localhost -N

Anonymous login successful

Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.2.4-0.21.fc9]

 

            Sharename       Type      Comment

            ———       —-      ——-

            docs            Disk      Document Share

            steven          Disk      User Steven Share

            IPC$            IPC       IPC Service (Samba Server Version 3.2.4-0.21.fc9)

Anonymous login successful

Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.2.4-0.21.fc9]

 

            Server               Comment

            ———            ——-

            LOCALHOST            Samba Server Version 3.2.4-0.21.fc9

 

            Workgroup            Master

            ———            ——-

            MYGROUP          

  

Copy a file to the directory to test.

[root@localhost ~]# smbclient //localhost/steven -Usteven%123

Domain=[LOCALHOST] OS=[Unix] Server=[Samba 3.2.4-0.21.fc9]

smb: \> put /home/condor/hello.c hello.c

putting file /home/condor/hello.c as \hello.c (1.0 kb/s) (average 1.0 kb/s)

smb: \>

 

 

 

NAD710 Lab6


1.What does the “rpcinfo -p” command do?

Answer:

The “rpcinfo -p” command shows all RPC services registered on the machine .

 

2.What information is stored in the /etc/exports file?

Answer:

The /etc/exports file contains an entry for each directory that can be exported to NFS clients.

 

3.What information is provided by the “showmount -e” command?

Answer:

The list of exported directories is provided by the “showmount -e” command.

 

4.What is the location (path name) of the Loadable Kernel Module of the NFS file system driver?

Answer:

When I issue the command “modinfo nfs”, I can find it in the output as follow.

/lib/modules/2.6.24.4-64.fc8/kernel/fs/nfs/nfs.ko

 

5.Who is the owner of the files /nfs-mnt/passwd.c-root and /nfs-pub/passwd.c-root? Are the same owner? If not, why not?

Answer:

“nobody” is the the owner of the files /nfs-mnt/passwd.c-root and /nfs-pub/passwd.c-root. They are the same.

Their uid and gid are all 65534.

6.Who is the owner of the files /nfs-mnt/passwd.joker-s and /nfs-pub/passwd.joker-s?

Answer:

“joker-c” is the owner of the files /nfs-mnt/passwd.joker-s.

“joker-s” is the owner of the files /nfs-pub/passwd.joker-s.

 

7.Who is the owner of the files /nfs-mnt/passwd.joker-c and /nfs-pub/passwd.joker-c?

Answer:

“joker-c” is the owner of the files /nfs-mnt/passwd.joker-c.

“joker-s” is the owner of the files /nfs-pub/passwd.joker-c.

 

8.Who is the owner of the files /nfs-mnt/passwd.nad710 and /nfs-pub/passwd.nad710?

Answer:

“nad710” is the owner of the files /nfs-mnt/passwd.nad710 and /nfs-pub/passwd.nad710.

 

9.Who is the owner of the files /nfs-mnt/group-nrs.root and /nfs-pub/group.nrs.root

Answer:

“root” is the owner of the files /nfs-mnt/group-nrs.root and /nfs-pub/group.nrs.root.

 

10.Did the file /nfs-mnt/hosts-ro.root being created? If not, why not?

Answer:

No, because the permission of the server’s “/nfs-pub” directory was set to read-only for the client.

 

 

NAD710 Lab5

1. What is the version number of the installed BIND package?

Answer:

   9.5.0-P2

 

2. What is bind tool called “named-checkconf” use for?

Answer:

   “named-checkconf” checks the syntax, but not the semantics, of a named configuration file.

 

3. What is bind tool called “named-checkzone” use for?

Answer:

  “named-checkzone” checks the syntax and integrity of a zone file. It performs the same checks as named does when loading a zone. This makes named-checkzone useful for checking zone files before configuring them into a name server.

 

4. What are the names of all the other tools in the bind package?

Answer:

/usr/sbin/dns-keygen

/usr/sbin/dnssec-keygen

/usr/sbin/dnssec-signzone

/usr/sbin/lwresd

/usr/sbin/named

/usr/sbin/named-bootconf

/usr/sbin/named-checkconf

/usr/sbin/named-checkzone

/usr/sbin/named-compilezone

/usr/sbin/rndc

/usr/sbin/rndc-confgen

 

5. We have used the dig and nslookup bind utilities in this lab, what are the other two bind utilities and what are they for?

Answer:

The other two bind utilities are “host” and “nsupdate”.

/usr/bin/host

“host” is a simple utility for performing DNS lookups. It is normally used to convert names to IP addresses and vice versa.

/usr/bin/nsupdate

“nsupdate” is used to submit Dynamic DNS Update requests as defined in RFC2136 to a name server. This allows resource records to be added or removed from a zone without manually editing the zone file. A single update request can contain requests to add or remove more than one resource record.

 

6. What is the information provided by the “service named status” command?

Answer:

version: 9.5.0-P2

number of zones: 15

debug level: 0

xfers running: 0

xfers deferred: 0

soa queries in progress: 0

query logging is OFF

recursive clients: 0/0/1000

tcp clients: 0/100

server is up and running

named (pid 3166) is running…

 

7. Will the “version” statement in the “/etc/named.conf” file change the output of the “service named status” command?

Answer:

Yes.

It will change the version line to “version: 9.5.0-P2 (version.bind/txt/ch disabled)”.

 

8. The SOA resource record in a zone file contains 5 numbers, what is the usage of the last one?

Answer:

It is used for “default TTL”. When the TTL is not declared, this number will replace it.

 

 

 

NAD710 Lab4

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

Answer:

/etc/sysconfig/network

 

2.Which file stores the static IP addresses?

Answer:

/etc/hosts

 

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

Answer:

/etc/hosts

 

4.Which file stores the DNS servers’ IP addresses?

Answer:

/etc/resolv.conf

 

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

Answer:

The /etc/sysconfig/network file is used to specify information about the desired network configuration on your server. Following is the content of this file in Lab machine.

NETWORKING=yes

HOSTNAME=lkzdns

 

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?

Answer:

$find . |xargs tar cvf backfile.tar

 

 

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

         1.system-config-firewall

         2.system-config-printer

         3.system-config-users

         4.system-config-display

         5.system-config-services

Answer:

I choose the “system-config-users” program to make a user. The following files are being used to store the configure parameters.

/etc/passwd

/etc/shadow

/etc/group

/etc/gshadow

 

 

 

NAD710 Lab3

1.Write a tcpdump command to display all the packets your system sent to matrix. Do not do any name resolution for any fields in the packet but do display the physical addresses contained in the packets.

Answer:

#tcpdump -nn -e -r /tmp/lab3-pkts dst host 142.204.140.90

 

2.Write a tcpdump command to display all the packets sent to your system from matrix. Do not do any name resolution for any fields in the packet but do display the physical addresses contained in the packets.

Answer:

#tcpdump -nn -e -r /tmp/lab3-pkts src host 142.204.140.90

 

3.Write a tcpdump command to display all the ARP packets captured in the packet file (lab3-pkts). Include the output in your answer.

Answer:

#tcpdump -r /tmp/lab3-pkts arp

reading from file /tmp/lab3-pkts, link-type EN10MB (Ethernet)

15:05:52.392161 00:16:76:35:8e:90 > 00:0e:0c:4b:31:5c, ethertype ARP (0x0806), length 42: arp who-has 142.204.141.129 tell 142.204.141.152

15:05:52.393155 00:0e:0c:4b:31:5c > 00:16:76:35:8e:90, ethertype ARP (0x0806), length 60: arp reply 142.204.141.129 is-at 00:0e:0c:4b:31:5c

15:06:02.314141 00:0e:0c:4b:31:5c > 00:16:76:35:8e:90, ethertype ARP (0x0806), length 60: arp who-has 142.204.141.152 tell 142.204.141.129

15:06:02.314155 00:16:76:35:8e:90 > 00:0e:0c:4b:31:5c, ethertype ARP (0x0806), length 42: arp reply 142.204.141.152 is-at 00:16:76:35:8e:90

15:06:44.221967 00:0e:0c:4b:31:5c > 00:16:76:35:8e:90, ethertype ARP (0x0806), length 60: arp who-has 142.204.141.152 tell 142.204.141.129

15:06:44.221981 00:16:76:35:8e:90 > 00:0e:0c:4b:31:5c, ethertype ARP (0x0806), length 42: arp reply 142.204.141.152 is-at 00:16:76:35:8e:90

… …

 

4.Write a tcpdump command to display all the ICMP “echo-request” packets in the packet file. Include the output in your answer.

Answer:

#tcpdump -r /tmp/lab3-pkts icmp|grep “echo request”

reading from file /tmp/lab3-pkts, link-type EN10MB (Ethernet)

15:05:57.314605 00:16:76:35:8e:90 > 00:0e:0c:4b:31:5c, ethertype IPv4 (0x0800), length 98: 142.204.141.152 > 142.204.140.90: ICMP echo request, id 22036, seq 1, length 64

15:05:58.314195 00:16:76:35:8e:90 > 00:0e:0c:4b:31:5c, ethertype IPv4 (0x0800), length 98: 142.204.141.152 > 142.204.140.90: ICMP echo request, id 22036, seq 2, length 64

 

5.Write a pipe line command, using tcpdump as part of the pipe line, to display the total number of packets belonging to the TELNET session between your system and matrix.

Answer:

#tcpdump -r /tmp/lab3-pkts tcp port 23|wc -l

 

6.Do the same for the SSH session.

Answer:

#tcpdump -r /tmp/lab3-pkts tcp port 22|wc -l

 

7.Write a pipe line command, using tcpdump as part of the pipe line, to display the total number of TCP packets in the packet file.

Answer:

#tcpdump -r /tmp/lab3-pkts tcp|wc -l

 

8.Do the same for UDP packets.

Answer:

# tcpdump -r /tmp/lab3-pkts udp|wc -l

 

9.Describe the steps you could use to find out all MAC addresses captured in the packet file. Include all the MAC addresses found in your answer.

Answer:

#MAC_M=”[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]”

#tcpdump -n -e -r lab3-pkts|grep -io $MAC_M|sort|uniq

reading from file lab3-pkts, link-type EN10MB (Ethernet)

00:0e:0c:4b:31:5c

00:16:76:35:8e:90

 

 

10.Describe the steps you could use to find out the total number of bytes your system received from matrix.

Answer:

 

 

 

11.Write a tcpdump command to capture all your traffic on port 80 and then open the website google.ca make a search about “arcade” and then verify your captured data.

Answer:

#tcpdump -i eth1 tcp port 80

 

 

 

NAD710 Lab2

1.What is the effect of the first “ifconfig ethxx down” command on the system’s ARP cache?

Answer:

    After run the first command “ifconfig eth0 down”, the system’s ARP cache becomes empty.

 

2.What command disable ARP on a network interface?

Answer:

    #ifconfig eth0 down

    #ifconfig eth0 -arp

 

3.How do you enable ARP on a network interface if it has been disabled?

Answer:

    #ifconfig eth0 down

    #ifconfig eth0 arp

    #ifconfig eth0 up

 

4.What is the consequence of disabling ARP on a network interface?

Answer:

The machine won’t be able to map the IP addresses to MAC addresses. Therefore, it won’t

be able to send frames to the network and receive from the network. 

 

5.How do you manually add an entry to the ARP cache?

Answer:

    #arp -s nnn.nnn.nnn.nnn xx:xx:xx:xx:xx:xx

    Note: nnn.nnn.nnn.nnn means IP address

          xx:xx:xx:xx:xx:xx means MAC address

 

6.What would be the possible advantage of disabling ARP on a network interface?

Answer:

    The possible advantage is that it can provent the system from the ARP virus.

 

7.Describe the procedure you used in determining the life time of an ARP cache entry on a  Linux system.

Answer:

 

 

 

NAD710 Lab1

1.What is the kernel version of Linux on matrix?

Answer:

2.6.18.8-0.5-default

 

2.What is the IP address and MAC address of the Linux machine on matrix?

Answer:

IP address–192.168.1.70

MAC address–00:03:47:E9:89:B5

 

3.What is the network mask on matrix?

Answer:

Network Mask–255.255.255.0

 

4.What are the network addresses of the Linux machine? (there should be three networks)

Answer:

192.168.1.0

169.254.0.0

127.0.0.0

 

5.What is the IP address of the gateway for the Linux machine on matrix?

Answer:

192.168.1.254

 

6.What is the command to display all the currently loaded kernel modules?

Answer:

/sbin/lsmod

 

7.Where is the file for the kernel module called “e100”?

Answer:

/lib/modules/2.6.18.8-0.5-default/kernel/drivers/net/e100.ko

 

8.What is the MAC address for the network device that has the IP address 192.168.1.254?

Answer:

00:0E:0C:7F:84:6F

 

9.How do you display all the physically network addresses known by a Linux machine?

Answer:

/sbin/arp -n

 

10.What is the MAC address of the network device on the default gateway for the Linux machine on matrix?

Answer:

00:0E:0C:7F:84:6F

 

 

 






Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: