Pages

Monday, June 13, 2011

File sharing

Q1. Share /tmp as rw on your network using NFS.



Q2. Share /tmp as linux_share using samba share. User smith(belonging to your network) should be able to read and write on the directory.

Networking iptables

Q1. Configure POP3 server such that user from your network can download mails from the server. 192.168.5.0/24 network should not be able to download mails from the server.

Q2. Provide SSL encapsulated imap access. Imap service should be available to your network only. Reject all other networks.

Networking TCP wrapper

Q1. Configure ssh such that it can be accessed by your network but not by 192.168.1.0/24 network.

Q2. Configure ftp on your machine such that clients on your network has anonymous ftp access. Deny all other network.

Partitions

Q1. Create a Raid 0 partition of 100MB size.

Q2. Create a logical volume of 500MB.

Q3. Change the size of the logical volume to 500MB.

NIS

Configure NIS client and mount it's home directory automatically.



Kernal

Install new kernal and make it the default one.

Yum

Configure yum repository.

Printing

Configure a network printer and make it default.

Finding

Q1. Find all files named ending with .conf

Q2. Find all files names star.jpg case insensitive.

Q3. Find all files in /etc which has pass in its filename.





Q4. find all files in /home owned by user smith and group matrix

Q5. Find all files in /home owned by user smith and not in group terminator.

Q6. find all files not belonging to users adam and eve.

Q7. find all files which has a permission of 755.

Q8. find all files larger than 10MB

Q9. Find all files in /tmp which were modified 10 mins ago.

Q10. find all files belonging to user smith in /home and move then to /tmp

Scheduling

Q1. Do a one time job to run /bin/echo hello at 1530.

Q2. Schedule a cron job for user harry which will run daily at 7:30 pm and run /bin/echo hellow

Q3. Schedule a cronjob for user tommy which runs /bin/echo hello every 5 minutes

Q4. deny user mary from scheduling cronjobs.

String processing

Q1. command for finding the number of files in /usr/sbin. The output must be single integer.

Q2. List the misspelled words in /usr/share/doc/HTML/en_US/index.html file.

Q3. How many times does each misspelled word appear?

Q4. Print /etc/passwd line for any account that starts with the letter g

Q5. Print number of lines in /etc/passwd file

Q6. Print only the list of user only from /etc/passwd file

Q7. Print the /etc/passwd line for any account that is using a bash shell

Q8. Print all accounts from /etc/passwd not using bash shell

Q9. Print a list of files in /etc/ that contain the word root. Display only the file names, not the matches, do not print any errors.

Q10. Print the shell being used by user root. only print the shell.

Q11. Display the first 3 lines of /etc/passwd file


Scripting

Q1. Write a bash script print.sh which echoes Fedora when the user input is redhat and redhat when the user input is fedora. For every other input echo ./print.sh fedora|redhat .

Q2. Write a bash script file.sh which echoes the file file2 when the user input is file1 and file2 when the user input is file2. For every other input echo error.

Q3. Write a bash script to check which all hosts are available on your network.

Permissions

Q1. Write down symbolic representation (eg rwxrw-r--) for each of the following numeric permissions
755
777
644
600
730
555
641






Q2. Give a file permission of 755

Q3. Change the permission of a file to r-xr--r--

Q4. Change the group permission of a file to writable.

Q5. Change the ownership of a file to user smith and group matrix.

Q6. ls –l on a file shows
-rwxr-xr-- 1 anderson matrix 2352 Nov 12 15:16 abc.sh

Which permissions do the user Anderson have

Which permissions are granted to members of the group matrix

Which permission are granted to user gump who is not a member of group matrix