Question

In: Computer Science

Goal: in this lab, you will learn to configure sudo to allow a user mrussell to...

Goal: in this lab, you will learn to configure sudo to allow a user mrussell to change
password for users. Please follow the steps and answer all the questions at the end of
the lab instruction.

In the Linux machine

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. For this part you will need a 2nd normal user (non-root) account. If you don't have
an account for "auser" with password “room1202” yet, you can create one by
running (as room1202):
$ sudo useradd -c "A User" auser
$ sudo passwd auser
2. Login as room1202, run the $ sudo visudo to edit the configuration file for sudo
to allow a normal user account (mrussell is used below) to change passwords for
users. The new entry should look like this (tab key as column dilimeter):
mrussell ALL = /usr/bin/passwd
3. Login as mrussell. What happened, if you use passwd to try to lock the account
for auser as follows:
$ passwd -l auser
4. Now try it again using sudo. This is done by running the command as normal
but with the word sudo in front:
$ sudo passwd -l auser
What output did you see from sudo? Did you lock the account this time? (Check
with sudo passwd -S auser.)
5. Try to unlock the account without using sudo:
$ passwd -u auser
What output did you see this time? Is the account unlocked now?
6. Unlock the account using sudo. What happened this time?
7. Using what you have learned about finding and reading system documentation,
enable the user mrussell to run the following command
$ sudo sudoedit /etc/hosts
Questions:
1. What file does the command visudo actually edit? (20pts.)
2. Compare the outputs from step#3 with those from step#4. What caused the
difference? (20pts.)
3. What output did you see in step#5? Then run sudo passwd –S auser and descript
what you see. (20pts.)
4. What output did you see in step#6? Then run sudo passwd –S auser and descript
what you see. (20pts.)
5. Save a screenshot in your report to prove that, on your system, you have
successfully completed step 7. (20pts.)

Solutions

Expert Solution

Answer 1
*************

Answer 2
****************

Answer 3
**************

Answer 4
***************

Answer 5
************

Answer 5 6
**************

without sudo command some system files not allowed except root user

Answer 7
*****************

1)
/etc/sudoers.tmp

2) user will get locked out with sudo user only

3) it changes the flag to L[lock flag] instead of P

4) it shows the state of the user


Thanks


Related Solutions

At the reading of the will, you learn that your inheritance will allow you to receive...
At the reading of the will, you learn that your inheritance will allow you to receive the amount of $480 at the end of each year for a total of 13 consecutive years. However, because of your young age, these amounts will not begin until the end of 6 years. If the interest rate is 7%, what is the equivalent present value of the inheritance?
Learn by Doing Matched Pairs: In this lab you will learn how to conduct a matched...
Learn by Doing Matched Pairs: In this lab you will learn how to conduct a matched pairs T-test for a population mean using StatCrunch. We will work with a data set that has historical importance in the development of the T-test. Paired T hypothesis test: μD = μ1 - μ2 : Mean of the difference between Regular seed and Kiln-dried seed H0 : μD = 0 HA : μD > 0 Hypothesis test results: Difference Mean Std. Err. DF T-Stat...
In C code format please! 4.16 LAB: Checker for integer string Forms often allow a user...
In C code format please! 4.16 LAB: Checker for integer string Forms often allow a user to enter an integer. Write a program that takes in a string representing an integer as input, and outputs yes if every character is a digit 0-9. You may assume that the string does not contain spaces and will always contain less than 50 characters. Ex: If the input is: 1995 the output is: yes Ex: If the input is: 42,000 or 1995! the...
Excel Lab 2: Regression and Goal Seek In this lab, you will use Excel to determine...
Excel Lab 2: Regression and Goal Seek In this lab, you will use Excel to determine the equation of the model which best fits a set of ordered pairs obtained from data sets. You will enter data, graph the data, find the equation for the regression model, and then use that equation to make predictions for the dependent variable. You will use the goal seek to make predictions for the independent variable. Then you will consider how accurate your predictions...
The Problem Statement In this lab section, you are going to learn how to sort an...
The Problem Statement In this lab section, you are going to learn how to sort an array of integers, and to sort an array of objects. We are going to divide the work into two parts. Part 1. Sorting an array of integers using selection sort In this part, you are given the code (see List 1) for sorting an array of integers into ascending order. The sorting method used is the selection sort. You can cut-and-paste the code into...
In c++, modify this program so that you allow the user to enter the min and...
In c++, modify this program so that you allow the user to enter the min and maximum values (In this case they cannot be defined as constants, why?). // This program demonstrates random numbers. #include <iostream> #include <cstdlib> // rand and srand #include <ctime> // For the time function using namespace std; int main() { // Get the system time. unsigned seed = time(0); // Seed the random number generator. srand(seed); // Display three random numbers. cout << rand() <<...
n this assignment, you will need to code a Web page that will allow a user...
n this assignment, you will need to code a Web page that will allow a user to enter their first and last names and indicate how many pets they have, if any. If they have pets, the user will be able to list up to three of their names. You will code validations on some of the fields and display error messages on the page when a field does not pass the validation test. If all the data entered is...
***USING JAVA Scenario: You will be writing a program that will allow a user to find...
***USING JAVA Scenario: You will be writing a program that will allow a user to find and replace misspelled words anywhere in the phrase, for as many words as the user wishes. Once done (see example runs below), the program will print the final phrase and will show the Word Count, Character Count, the Longest Word and the Shortest Word. Requirements: Do not use Arrays for this assignment. Do not use any String class methods (.phrase(), replace methods, regex methods)...
The aim of this lab is to learn the way of converting an ARRAY to a...
The aim of this lab is to learn the way of converting an ARRAY to a SET and the other way around. To complete this lab we need to remember the implementation of the Set Interface, HashSet Class, and Arrays. Build an array with some elements (String, Integer, or Float). Then initialize a set (using HashSet) with the elements of the converted array. To transfer an Array into a Set, firstly we have to convert it to a List using...
In this lab you will learn how to use methods from the Math class in order...
In this lab you will learn how to use methods from the Math class in order to calculate the area or the volume of several different shapes. If you are confused about the Methods you can access from the Math class and would like to see some examples click here. Hint: Most of these methods can be done in one line. Step 1 - circleArea In this method you will calculate the area of a circle. Before you can calculate...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT