Franske ITC-2480 Lab 3: Difference between revisions
Jump to navigation
Jump to search
BenFranske (talk | contribs) No edit summary |
BenFranske (talk | contribs) |
||
Line 18: | Line 18: | ||
== Practice Linux filesystem permissions and ownership == | == Practice Linux filesystem permissions and ownership == | ||
* NOTE: Working with file and directory ownership and permissions is tricky and there are many, many possible combinations of users, groups, and permissions which can be assigned to both files and folders. The goal of this section of the lab is to familiarize you with how to use the commands for changing ownership and permissions. Once you understand how to use the commands you should experiment with setting different owners and permissions on a several different files and folders and subfolders until you have a good understanding of how permissions work. The only way to understand these relationships well is to try it out. You should be able to set all of these permissions just as regular users (assuming you have access to both of the user accounts) you should not need sudo access because one of the the two users owns all the files and directories we're working in. | * NOTE: Working with file and directory ownership and permissions is tricky and there are many, many possible combinations of users, groups, and permissions which can be assigned to both files and folders. The goal of this section of the lab is to familiarize you with how to use the commands for changing ownership and permissions. Once you understand how to use the commands you should experiment with setting different owners and permissions on a several different files and folders and subfolders until you have a good understanding of how permissions work. The only way to understand these relationships well is to try it out. You should be able to set all of these permissions just as regular users (assuming you have access to both of the user accounts) you should not need sudo access to change the permissions because one of the the two users owns all the files and directories we're working in. You will need sudo access to change the owner of the files because otherwise it would be possible to accidentally lock yourself out of a file. | ||
# Change to the /home directory and check the ownership and permissions on the subdirectories inside of /home | # Change to the /home directory and check the ownership and permissions on the subdirectories inside of /home | ||
# Try to create new files using the touch command called foo and foo2 in the /home/jsmith directory as both your regular user and as jsmith respectively | # Try to create new files using the touch command called foo and foo2 in the /home/jsmith directory as both your regular user and as jsmith respectively |
Revision as of 17:41, 4 July 2014
Introduction
In this lab you will install the "sudo" administration package, create a new user account, change the ownership and permissions on files and directories, and install the Webmin package.
Lab Procedure
Prerequisites
- Make sure you have an active connection to the ITCnet either by VPN or by directly connectiong to an ITCnet switch on campus
- Open an SSH console to your Linux system using the PuTTY software, login with your standard user account
Create Linux users and groups
- Create a new user account "jsmith" using the adduser program
- Create a new group "redteam" using the addgroup program
- Add the jsmith account as well as your own user account to the redteam group
- In order for your user accounts to receive their new group permissions they need to be logged back in so close your SSH session and open two new SSH sessions, login as your regular user on one and jsmith on the other
- View a list of all the user accounts on your system by looking at the /etc/passwd file which is a plain text file on your system.
- To output the contents of the /etc/passwd file you can use the "cat /etc/passwd" command
- To output the contents of the file while pausing after each page of output use the "more /etc/passwd" command
- To output the contents of the file while pausing after each page of output and being able to scroll up and down through the output use the "less /etc/passwd" command and press q to return to the command line
Practice Linux filesystem permissions and ownership
- NOTE: Working with file and directory ownership and permissions is tricky and there are many, many possible combinations of users, groups, and permissions which can be assigned to both files and folders. The goal of this section of the lab is to familiarize you with how to use the commands for changing ownership and permissions. Once you understand how to use the commands you should experiment with setting different owners and permissions on a several different files and folders and subfolders until you have a good understanding of how permissions work. The only way to understand these relationships well is to try it out. You should be able to set all of these permissions just as regular users (assuming you have access to both of the user accounts) you should not need sudo access to change the permissions because one of the the two users owns all the files and directories we're working in. You will need sudo access to change the owner of the files because otherwise it would be possible to accidentally lock yourself out of a file.
- Change to the /home directory and check the ownership and permissions on the subdirectories inside of /home
- Try to create new files using the touch command called foo and foo2 in the /home/jsmith directory as both your regular user and as jsmith respectively
- Try removing the foo and/or foo2 files using both your regular user account and jsmith
- Use the jsmith user to create a new directory /home/jsmith/redteam/
- Use the jsmith user to create some files: /home/jsmith/redteam/theplan and /home/jsmith/redteam/yours /home/jsmith/redteam/mine and /home/jsmith/ours
- In order to find out more about the chown and chgrp programs which you'll use to change the owners and groups for files and directories use the "man chown" and "man chgrp" commands to view the built in manual pages. Almost every command line tool in Linux has a manual page you can view in this way, try accessing a few other man pages for some of the other tools we've been using. You can scroll through the manual pages using the arrow keys and page up/down. To return to the command line press the q key.
- Change the permissions on the /home/jsmith/redteam/ directory so that the group "redteam" is the group owner of the directory
- Add write permission for the group to the /home/jsmith/redteam/ directory
- Change the ownership of the yours file so that it is owned by your regular user account instead of jsmith
- Change the group owner of the ours file so that it is controlled by the redteam group
- Experiment with creating and removing files and subdirectories inside of the /home/jsmith/redteam/ directory as well as listing the contents of directories with various permissions applied to them until you have a good understanding of how permissions work.
Install the Webmin control panel
- Use the links browser to download the DEB package file from www.webmin.com
- Use dpkg -i to install the webmin DEB package
- Make a note of the unmet dependencies for the webmin package
- Use aptitude to install the dependencies for webmin
- Open a web browser on your host system and visit https://xxx.xxx.xxx.xxx:10000 where your IP replaces xxx.xxx.xxx.xxx
- Explore the webmin interface