Franske ITC-2480 Lab 3: Difference between revisions

From ITCwiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 12: Line 12:
##* Note: From now on you should simply put sudo in front of any commands that need to be run as root instead of logging on to the root account or switching to the root account with su
##* Note: From now on you should simply put sudo in front of any commands that need to be run as root instead of logging on to the root account or switching to the root account with su
# 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.
## Create a new user account "jsmith" using the adduser program
## Create a new user account "jsmith" using the adduser program
## Create a new group "redteam" using the addgroup program
## Create a new group "redteam" using the addgroup program
Line 18: Line 19:
## 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 called foo and foo2 in the /home/jsmith directory as both your regular user and as jsmith respectively
## Try to create new files called foo and foo2 in the /home/jsmith directory as both your regular user and as jsmith respectively
## Use the jsmith user to create three new directories /home/jsmith/redteam/ and /home/jsmith/redteam/stuff/
## Try removing the foo and/or foo2 files using both your regular user account and jsmith
## Use the jsmith user to create some files: /home/jsmith/redteam/stuff/theplan and /home/jsmith/redteam/yours /home/jsmith/redteam/mine and /home/jsmith/ours
## 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
## Change the permissions on the /home/jsmith/redteam/ directory so that the group "redteam" if the group owner of the directory
## Change the permissions on the /home/jsmith/redteam/ directory so that the group "redteam" if the group owner of the directory
## Add write permission for the group to the /home/jsmith/redteam/ 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
# Install the Webmin control panel
## Use the links browser to download the DEB package file from www.webmin.com
## Use the links browser to download the DEB package file from www.webmin.com

Revision as of 03:03, 30 January 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.

These same instructions apply if you are completing this lab using the VirtualBox virtual machine software or if you are connected to a machine running remotely on the VMware platform. If you are completing this on campus remember to switch your network connection to the SafeConnect-free ITCnet.

  1. Open an SSH console to your Linux system using the PuTTY software, login with your standard user account
  2. Practice using sudo
    1. Install the sudo package
    2. Add your user account to the sudo group using the "adduser ben sudo" command where ben is your username
    3. In order for your user account to receive their new group permissions it needs to be logged back in so close your SSH session and open a new SSH session logging back in as your regular user
    4. Try running the ifconfig command as your regular user with the "sudo ifconfig" command
      • Note: From now on you should simply put sudo in front of any commands that need to be run as root instead of logging on to the root account or switching to the root account with su
  3. 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.
    1. Create a new user account "jsmith" using the adduser program
    2. Create a new group "redteam" using the addgroup program
    3. Add the jsmith account as well as your own user account to the redteam group
    4. 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
    5. Change to the /home directory and check the ownership and permissions on the subdirectories inside of /home
    6. Try to create new files called foo and foo2 in the /home/jsmith directory as both your regular user and as jsmith respectively
    7. Try removing the foo and/or foo2 files using both your regular user account and jsmith
    8. Use the jsmith user to create a new directory /home/jsmith/redteam/
    9. 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
    10. Change the permissions on the /home/jsmith/redteam/ directory so that the group "redteam" if the group owner of the directory
    11. Add write permission for the group to the /home/jsmith/redteam/ directory
    12. Change the ownership of the yours file so that it is owned by your regular user account instead of jsmith
    13. Change the group owner of the ours file so that it is controlled by the redteam group
    14. 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.
  4. Install the Webmin control panel
    1. Use the links browser to download the DEB package file from www.webmin.com
    2. Use dpkg -i to install the webmin DEB package
    3. Make a note of the unmet dependencies for the webmin package
    4. Use aptitude to install the dependencies for webmin
    5. Open a web browser on your host system and visit https://xxx.xxx.xxx.xxx:10000 where your IP replaces xxx.xxx.xxx.xxx
    6. Explore the webmin interface


New Commands

  • sudo
  • adduser
  • dpkg
  • man
  • touch
  • cat
  • more
  • less
  • addgroup

Concepts

  • sudo