You are on page 1of 3

Cis 262, Lab 2 Linux Security Mr.

Nassar

Name Anthony Gill______

Creating Accounts in Red Hat Linux 7.3 There are 2 ways to create accounts: At the command prompt (terminal screen) Using a GUI interface in GNOME Naturally you want to use the GUI, but most Linux enthusiasts use commands. We will start with the commands, then go to the GUI. 1. Login as root and open up a terminal screen. 2. Some versions of Linux use the "adduser" command, some use "useradd", and some use both. Which command(s) does your system use?___both___ 3. When you type the command "adduser", Linux shows the correct usage of the command. Everything in [brackets] is optional. What is NOT in brackets? _____name _-D_____ 4. Since most features are optional, default values are used. The -D option shows you the default values. (Note: Linux is case sensitive so the option is a capital D.) Where will the user's home directory be created? __/home________ What is the default group number? __100______ 5. Create a user with a login name of student2 and a full name of "Tom Jones". The command will be: adduser -c "Tom Jones" student2 6. Set the password of student2 to cis262: passwd student2

7. Find the home directory using the cd command. What is the full directory name? __/home/student2________ 8. Create a user account for each of your group members using the command in step 5 with your full name and a login name that is your first name. Write the account names below: __Anthony Gill student10______ 9. Use the cat command to look at the user list and group member files: cat /etc/passwd cat /etc/group What is the user ID number for student2? ___501_______

Looking the /etc/group file, what is the name of the default group? _________ If you followed the installation instructions in the prior lab, you will also see a group called student. What number is it? __________ 10. Change the name of the student group to "students". Use a text editor such as gedit (Start-Programs-Applications-gedit) to modify the /etc/group file. 11. Now let's try the GUI. Go to Start-Programs-System-User Manager. There is a tab for Users and a tab for Groups. What is the primary group for "student"? ____user1______ What is the primary group for student2? __student2________ Why are they different? _________because I changed it_______ 12. Click the New User button. Create a student3 account. Full name "Mary Todd", password: cis262. UNCHECK the box labeled "Create a private group for the user" because we do not want a group named student3. 13. Click the Groups tab and select the students group. Click the Properties button, then the Group Users tab. Check the boxes for all of the accounts you created today, then hit ok. Which users are in the students group? ___________student10 2 amd 3_____________________________ Next we will create a subdirectory in the student2 home using the command prompt. 14. Stay logged on as root. Open a terminal window. 15. Change directory to the student2 home directory. What command did you use? ______/home/student2______________ 16. Make a subdirectory called my_files. What command did you use? ____________________ 17. Change the owner and group from owner=root group=root to owner=student2 group=students. Use the chown command and chgrp command. What command did you use to change the owner? ____________________ What command did you use to change the group? ____________________

18. Change the permissions for the new directory to allow: the owner to read, write and execute the group to read, write and execute everyone to read and execute Use numbers for the command. What command did you use? ____________________

19. Use gedit to create a file in my_files called page1.html Containing the following: <html> <h1> Page 1 for Group x </h1> </html> Note: Where it says Group x use your group letter, not x. Save the file. 20. Go back to the terminal window. Change directory to get into the my_files directory. Do you see the new file? _______ What are the permissions on the page1.html file? ______________________ What command did you type to see the permissions? ______________________ 21. Change the permissions on page1.html so that the owner can read/write, the group and other can read. What command did you use? ____________________ 22. If you brought other web pages to class, put them in this folder for now.

You might also like