Open main menu

CDOT Wiki β

Changes

OPS235 Lab 4 - CentOS7 - SSD

741 bytes removed, 12:40, 13 June 2016
no edit summary
#Perform this part in your '''centos1''' VM.
# Read the man page for the <b><code><span style="color:#3366CC;font-size:1.2em;">useradd</span></code></b> command.
# Create a new user called '''ops235_1 ''' by issuing the command: <b><code><span style="color:#3366CC;font-size:1.2em;">useradd ops235_1</span></code></b>
# Issue the command: <b><code><span style="color:#3366CC;font-size:1.2em;">grep ops235_1 /etc/passwd</span></code></b> to see if that user account was created.
# View the '''/home''' directory to view the contents. Is the user ops235_1's home directory there?
# Issue the following command to create the user called ops235_2: <b><code><span style="color:#3366CC;font-size:1.2em;">useradd -m ops235_2</span></code></b>
# View the '''/home''' directory to verify that the home directory for '''ops235_2 ''' has been created. What does the -m option do for the useradd command?
# Issue the following command to remove the user called ops235_2: <b><code><span style="color:#3366CC;font-size:1.2em;">userdel ops235_2</span></code></b>
# Issue the grep command with the /etc/passwd file to verify that the username ops235_2 was removed.
# View the contents of the '''/home ''' directory. Was the home directory for user '''ops235_2 ''' removed? As root, remove that directory. What option do you need to use with the userdel command to automatically remove the user's home directory?# Issue the userdel comamnd to remove the '''ops235_1 ''' account with the '''-r option''' (and home directory regardless if it exists or not).# Recreate the new user (with home directories automatically created) for '''ops235_1'''.# Use the '''passwd''' command to set the password for the user '''ops235_1'''.
# View the <u>contents</u> for ops235_1's home directory and note the files.
# Look at the man page for '''/etc/shadow''' using the command: <b><code><span style="color:#3366CC;font-size:1.2em;">man 5 shadow</span></code></b>
# Create a new file in the /etc/skel directory with the following command: <b><code><span style="color:#3366CC;font-size:1.2em;">touch /etc/skel/foo</span></code></b>
# Recreate the new user (with home directories automatically created) for '''ops235_2'''.
# Set the password for the user '''ops235_2'''.
# Grep View the <b><code><span style="color:#3366CC;font-size:1.2em;">/etc/passwd</span></codeu>contents</bu> file for each of the new users.#* What is the ''ops235_2's home''' directory of each user?#* What '''group''' is each user in?#* What other information can you provide regarding these users?#* Where are the '''passwords''' stored?# Look at the man page for '''/etc/shadow''' using the command: <b><code><span style="color:#3366CC;font-size:1.2em;">man 5 shadow</span></code></b>#* Grep the <b><code><span style="color:#3366CC;font-size:1.2em;">/etc/shadow</span></code></b> file for each of the new users.#* Make and note of this information. # Recreate the new users (with home directories automatically created) for <b><code><span style="color:#3366CC;font-size:1.2em;">ops235_1</span></code></b> and <b><code><span style="color:#3366CC;font-size:1.2em;">ops235_2</span></code></b>.# Investigate the home directory of one of your new users.#* What files are there? Be sure to include hidden files.#* What do you think these files are used for?#* How does the operating system determine which files are created in a new home account? The answer can be found here:<br>http://www.linuxhowtos.org/Tips%20and%20Tricks/using_skel.htm#* Look at the files (including hidden files) in the template directory referred to in the article. Compare them to what notice that is in a home directory for a new userdifferent. What do you notice?#* Create a new file in this directory with think is the purpose of the following command: <b><code><span style="color:#3366CC;font-size:1.2em;">touch foo</span></code></b>#* Create a new user named <b><code><span style="color:#3366CC;font-size:1.2em;">foobar</span><etc/code></b>, with the option to automatically create a home directory.#* Look at the contents of foobar's home skel directory. What do you notice?
# Be sure to record your observations in your lab notes.
#Issue the man pages for the '''useradd''' command. Explain the purpose of using the '''-eE''' option for the ''useradd'' command. Try #Issue the following command: <b><code><span style="color:#3366CC;font-size:1.2em;">chage -E 2018-05-31 ops235_1</span></code></b># Issue the following command to think what would be obtain information regarding the purpose for a Linux sysadmin to use this option when creating new users.user called ops235_1:
13,420
edits