UCULUI Section 2:- Environment Variables :- The system uses the dot files to store variables that are used to manage your session. The printenv command is used to bring these variables together. 1. Looking at Environment Rointenyl more What is variables. You should see the Hostname of the variables and the values to machine that you which they have been set. are using? Use the space bar to see more Name of the shell variables. being used? Type of terminal are you using? Your PATH set to? 2. Understanding the PATH Is-al /usr/bin/ more Do you see any The PATH is defined as a set of command files which directories that the system correspond to some of searches to locate the the commands that we command file which executes have been using such the command typed at the as is, more, Rwd? terminal. In UNIX, each Write them down in command you type is actually. your log book. a program which is executed by the shell. That program is stored in a file and the name of the file usually corresponds to the name of the command. To look at the commands in the /hin directory Select Adobe PDF Styles Editing Adobe Act: Reactivate 3. to the name of the command. To look at the commands in the /bin directory Using the which command he which more which command searches your path and tells you where the command file for a given command is located. Write down where the more command file is located. Use the which command to also verify the locations of the following commands, pwd undic and Whoami Section 3:- Process and System Monitoring Linux has several ways of telling you about processes or tasks in the system. 1. Using the ps command Ps Write down what Note that in UNIX, a task is you find. These are another way of calling a the processes or process or an executable tasks that you are program. running The ps command lists Note that the symbol processes or tasks running in or name under the the system CMD or command is also the name of process. In UNIX, a process is usually named after the command it executes. Write down the process ID or PID of your shell ps aux / more Find out about all the processes or tasks running in the system, What is the command or name for the process with PID 12 Note if the command or name is in file format, i.e. /xxxx/yyyy, then the 2. top Using the top command The top command is also used to report on processes or tasks as well as other system info. Find out what is the total number of processes or tasks running in the system? How many processes or tasks are sleeping? The id parameter I stands for the idle status. Find out what percentage of time the processor is idle? 3. JUICUS CRUCE Answer the following questions: (Hint: use the cpuinfo file) Using /proc - Both the ps and Type: cd /proc top commands use a special Type: Is to see the directory called /proc. files This directory contains system information. Let's go to the Use the more /proc directory command to look at the contents of the following files spuinfo, meminfo and interrupts. What type of processor is running (Pentium, Celeron, Intel Core Duo, etc.)? What is its speed? What is the? How many size of the I processor cache CPUs does your computer have? (Hint: use the meminfo file) What is the total amount of memory in the system? How much memory is being used? How much memory has been allocated for swap space? How much swap space is actually being used? Reactivate Password: greotiah Administering UNIX UNIX really only has two classes of users. The first is simply a user of the system while the second is the superuser who is expected to administer the machine. The superuser has all the authority and can do anything. Normally to do what we have to do in this Lab one would need to be the superuser. But since you are inexperienced and we cannot afford to have our machines trashed, we have used a different facility to provide you with additional powers. The facility is called the sudo system. It instructs the system to allow root privileges to users and groups in a controlled way. The first time you use sudo you will be asked for a password. This is the password for the admin account (.e. greatob). Please be careful. 1. Understanding Groups UNIX has the concept of I groups for people doing collaborative work or for people or services that need certain privileges. Open a terminal window Type: man groups write a brief summary of how groups are managed. Users can see the group(s) to Type groups which they belong. write down the answer you get for the admin account. First we need to ensure that Type: user clunix does not already sudo/usi/sbin/userde! exist. So we first tell the - cunix If the system asks for a password, use the one for the admin Focus W 3 II 2. Adding a new group Type The system will ask It would be good to add a new Sude Zusc/skin/acourade you for a password, group for this project. So let's quasor type the password for try to add a new group called admin account. quasar. To do this we need to use the command groupadd. Type more /etc/group Write down the group to see of a new group id or gid for the quasar called quasar has been group. added 3. Creating User Accounts General information on users is kept in the /etc/passwd file on UNIX systems. Type more /etc/passwd Write down all the fields for the guest account, which you used in for parts 1&2. What is /home/guest? What is /bin/bash? 4. some I II Creating accounts UNIX, Linux included, has very powerful commands for administering user accounts. Adding a new account is done using the command useradd. There are many options so you have to be careful with how this account is created. Let's do a user account for Colin Unix. We need to note a few things: 1) We need to select a user name or login, let's call him clunix 2) We need to make sure that he is in the quasar group 3) We need to tell the system that his account should expire when the Four 18 account is created. Let's do a user account for Colin Unix. We need to note a few things: 1) We need to select a user name or login, let's call him clunix 2) We need to make sure that he is in the quasar group 3) We need to tell the system that his account should expire when the project ends 4) We want to use him to Type man useradd use the bash shell as his default shell. I Select the options that can Type :- Again, if you are asked fulfill the requirements 2, 3, sudo /usr/sbin/useradd for a password, type and 4. e 2018-12-18 -9 the password for the So let us create the user quasar -5 /bin/bash admin account. account for Colin Unix. clunix WAN Setting up a Password In UNIX, an account must have a password to be active. Normally, this can only be done by superuser. However we have used the sudo facility to allow you to set up the password for Colin. Choosing a good password is an important part of the security system in UNIX. Lots of security breaches have occurred because it was easy to guess a user's password. Choose a password for Colin which has 8 characters. A good password should include numbers and letters - both common and capital letters - and at least one of the non-alphanumeric characters such as $,%, &, etc. Please WRITE the password in the line below: Password: Type sudo /usr/bin/passwd dunix Set up the new password for Colin. I OK, now Colin should be able to log on to the machine. Reboot the machine. 5. Now login in as Colin. So user name: clunix Password: (use the one you made up) Open a terminal window and Verify that you are indeed clunix by typing the command: whoami Is Colin in the quasar group? Tune around