Linux-Practicals Odt
Linux-Practicals Odt
Q1. Set the IP address of your machine to 172.24.10.X belonging to 172.24.10.0/24 network (hcltalent.com)
with DNS and Gateway set to 172.24.10.254.
Q2. Set hostname of your machine to workstationX.hcltalent.com
Q3. Create following tree structure:
c
Q6. Create a 1GB ext4 partition and mount it permanently on directory '/data/' and copy all the files from
'/etc/' directory in it.
Q7. Create a user 'smith' having password 'RedHat'. This user must be the owner user of '/data/'
directory.
Q8. Create a group 'sysadmin' with password '$y$4dmin'. This group must be the owner group of '/data/'
directory.
Q10. User 'jack' should be the owner of all the files in '/data/' directory which starts with character
'a,c,e,g,j,n,p,t'.
Q11. Create a group 'fakes' and make it the group owner of all the files owned by 'jack' in '/data/'
directory.
Q13. Copy file ‘/etc/fstab’ in ‘/data/acl’ directory and configure permissions of ‘/data/acl/fstab’ so that:
Owner user and owner group is ‘root’ user and ‘root’ group respectively with permissions 640
Q14. You should be able to ping “slocum.in” which should resolve to your loopback.
Q15. Make sure SSH service is running on your machine and should only be accessible to 172.24.10.0/24.
Q16. Configure rsyslog such that all the mail logs are also stored in ‘/var/log/mymaillog’ file as well.
Q17. Set umask to 000 and then create a file called /root/Documents/world.txt containing the words "hello
world". List the permissions of this file.
Q18. List all processes running on system using ps, use sed to substitute "me" for “root” from the output of
ps.
Q19. Use awk on /etc/passwd to produce a list of users and their login shells.
Q20. Create a directory '/data/test/' and create files file1.txt through file4.txt in it. Write a shell script
'/data/bin/txt-to-text' which renames all .txt files in '/data/test/' as .text files.
Q21. Append /data/bin to PATH shell variable and make 'txt-to-text' script as a command.
Q22. Your home directory is situated on which partition. Run the command to find out and save the output
in ‘/data/test/home-path’ file
Q23. How many partition are present on your system. Run the command to find out and save the output in
‘/data/test/total-partition’ file
Q24. Save search path for root user in ‘/data/test/search-path’ file
Q25. Save the system uptime in ‘/data/test/uptime’ file
Q26. Save the memory (RAM) usage and swap usage of your system in ‘/data/test/mem-usage’ file
Q27. What module are loaded on your system. Save the list in ‘/data/test/modules’ file
Q28. Save the programs that come with the GNU coreutils package in ‘/data/test/coreutils-files’ file
Q29. Store version of bash installed on your system in ‘/data/test/bash-version’ file
Q30. Save the contents of ‘/’ in reverse order in /data/test/root-contents-rev’ file
Q31. Make a symbolic link to /var/tmp/ in /data/test/ directory
Q32. Make an alias ‘la’ for root user which actually executes ‘ls –la’
Q33. Make a gzip compressed backup of /etc/sysconfig in /data/archives/ directory using tar command. The
file should be named etc.tar.gz.
Q34. Write network information of your workstation: IP Address, Default Route and name server in
/data/test/network-info file in following order and syntax:
IP: X.X.X.X
Gateway: X.X.X.X
DNS: X.X.X.X
Q35. Make a list of open (listening) ports (tcp and udp both) on your system and store the output in
‘/data/test/open-ports file
Q35. Store the information of who connected to your system and when in ‘/data/test/all-logins’ file
Q36. Configure IP packet forwarding on your machine.
Q38. Increase the GRUB menu timeout to 15 seconds
Q39. Add user evelin with uid 3119, gid wheel, shell nologin and home directory /home/mydir-eve
Q40. Create an xz compressed tar archive '/data/archives/etc.tar.xz' of all the files in /etc ending in ‘.conf’.
Q41. Share /data/test via NFS as read only for 172.24.10.0/24 network only.
Q42. Create a user 'sachin' who is a member of 'cricket' group (sec. group) with password 'wc2011win'
Q43. Create a collaborative directory '/data/cricket/' so that all the files created in this directory will have
group ownership set to 'cricket' group.
Q44. Make sure on '/data/sticky/', which has 777 permissions, that only the owner user is able to remove
the files/directories.
Q45. User ‘sachin' should not be allowed cron service.
Q46. Configure email alias so that mails sent to 'sysadmin' should be received by root
Q47. Configure a script ‘/data/bin/ask-name’ to ask the user their name and print error “no name provided”
if nothing is entered and the message “Hello <username>” if name is entered correctly.
Q48. Store the list all available block devices in /data/test/block-devices
Q49. Store the list all the files that come with the kernel package in ‘/data/test/kernel-files’