Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Institutionen för 2015-02-26 Tillämpad fysik och elektronik Ola Ågren/Stig Byström Originalförlaga: Lars Sjöberg Linux Experiment - assignment Goals: Install and familiarize yourself with a common Linux distribution, its configuration and some system administration. Learn how to manage users, groups and resources. Learn how to write basic bash scripts. Learn Equipment Elaboration computer (server). Client computer for testing FTP and SSH access. Network What to do: Read the instructions. Connect the computers the the network. Install a Linux distribution (recommended Ubuntu 10.04 LTS) and make the configurations and tasks listed below. All configurations and tasks should be done in the command-line interface (CLI). You have to finish each task before you move to the next. Each task may give you one (1) point. Rev E Task 1 Linux-server. 1p A. Install Linux. B. Test the following Linux commands, read the man-pages and make sure you understand what they do and how they work. ls cd cd .. cd / cd~ pwd mkdir, rmdir cp, mv, rm cat, tail df echo find, which, locate wget grep, sort, wc, sed, gawk mount tar, gzip ps, top kill who, whoami, su, finger shutdown, poweroff, exit, reboot sudo C. Start a text editor and make sure you learn how to open, save, search within and close files. Make sure to familiarize yourself with it – it will be your most important tool during this assignment! D. Configure the network. Tip: ifconfig, route and resolv.conf E. User administration. 1) Create user accounts for Linus, Bill and Steve. All three must have a working home directory and a password. 2) Create two groups: economy and finance. Add Linus and Bill to economy and Steve to finance. 3) Create two directories economy and finance in /home. 4) Set the permissions so that only the economy group has read-write access to the economy directory and the finance group to the finance directory. All new files created in these directories should automatically belong to the group associated with the directory. 5) Make sure that everyone with read-write access to a directory has full access to all files in that directory. Bill should be able to open and edit a text file that Linus created in the economy directory. (tip: umask) 6) Write a BASH script that automatize adding user account, use the script to create user accounts for Anna, Charlotta and Ida. All three must have a working home directory and a password. 7) Add Anna, Charlotta and Ida to the finance group. 8) Change the password for Anna then remove the user account. Restore the user account. Compare the files /etc/passwd, /etc/shadow, /etc/group and /etc/gshadow. It is recommended to copy the files first (use the command cp, the directory /tmp is used to store temporary files and gets cleaned up at system boot). Open the files with the command cat <file>. Document your findings. F. List all processes that your user is running on the system. Write the result both to the screen and to a file: processes.txt. Document any processes that most likely are daemons and explain why you think they are daemons G. Start the application xeyes. Pause, continue and stop the process with the kill-command. Document the options you used. H. Install and configure a FTP server. Configure the server to: 1. Block anonymous logins. 2. Create a FTP user that only has access to a dedicated FTP directory. (tip: chroot) 3. Connect to the FTP server from the client computer and test your configuration. 4. Document the settings you used. Tip: restart the daemon to load changes made to the configuration file. I. Install and configure an SSH-daemon. Configure the daemon to: 1. Only allow the users Bill and Ida to login. 2. Ida should be able to SU to root. 3. Connect to the system via SSH from the client computer. Test your configuration. 4. Using the user account Ida: login via SSH and change Steve’s password. 5. Document the settings you used. Tip: restart the daemon to load changes made to the configuration file. Task 2 (+1p) J. Ask the user if his/her home directory should be copied to /backup. If the user responds with Y the script should execute the backup operation. K. Create a script that automatically copies a user’s home directory to /backup at logon. (tip: .profile) L. Document your work. Task 3 (+1p) M. Create a cron job that updates the system clock every minute and writes the current time to a console of your choosing. N. Document your settings and attach a screen dump of the console printout. Tip: ntpdate. All open consoles could be found under /dev/pts/ and all “normal” text consoles under /dev/tty1-tty6. You can access these with to ctrl-alt-f1 – ctrl-alt-f6. Report: Show the tutor that your configurations work , you may only need to show some of the solutions. Put together a simple report including (E:6, E:8, F, G, H:4, I:5, L & N) and give/send it to the tutor. To observe: Installations and configurations during this course should be well documented, for your own sake.