Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the scp command and localhost as theremote host name, to copy the /etc/hosts file to the home directoryof the user account max . Remember

  1. Use the scp command and "localhost" as theremote host name, to copy the /etc/hosts file to the home directoryof the user account max.

    Remember the syntax of the scp command is: scp[[user@]remotehost:]source-file [[user@]remotehost:]target-file.Where:
    1. The parameters inside the braces ([...]) are optional, so ifyou are copying a file from your local system you don't need tospecify the [[user@]remotehost:] parameters for the source-filebecause the source-file (i.e. the /etc/host file in this step) islocal. In this example the scp command could be:

      scp /etc/hosts usr1@remotehost:

      You would need to enter the password for usr1 when prompted. Thiscommand copies the /etc/hosts file on the local system to usr1'shome directory on the remote host.
    2. If you don't specify a target-file name after the colon (:),the name of the source-file is used. For example, these commandsare equivalent:

      scp /etc/hosts usr1@remote-host:hosts
      and
      scp /etc/hosts usr1@remote-host: #note:there is no target file name specified

      You would enter the password for usr1's account on the remote hostwhen prompted for a password.
    3. If you don't specify a remote user name (usr1@ in the aboveexamples) then your account name is used by default. Forexample:

      scp /etc/hosts remotehost:

      You would enter the password for your user'saccount on the remote host when promptedfor a password. This command copies the /etc/hosts file on thelocal system to my user's home directory on the remote host.
  2. Use scp to copy and rename the /etc/hostsfile to the /tmp directory on the remote localhost system usingyour user's account on the remote system. (Note: Don't forget touse the name "localhost" for the remote system name.) Name the newfile hosts-XXX (replace XXX withyour initials).
  3. Use ssh, cd andthe ls commands to display the contents of thecopied file in step 2.
    1. Use your regular user account to login to the remote systemwith the ssh commandand localhost as the remote system name
    2. Use the cd command to change directories to/tmp
    3. Use the ls -l command (showing the owner) todisplay the contents of the /tmp directory
    4. Type exit to close the ssh networkconnection to the remote localhost and return to your localsystem
  4. Repeat step 2. using rsync in placeof scp; add the number 2 to the end of the name ofthe copied file (hosts-XXX2).
  5. Use rsync to copy the /etc/hosts file onthe client local system to your home directory onthe server remote system.
  6. Repeat step 3. The ls output should show the two files,hosts-XXX and hosts-XXX2,where XXX is replaced by your initials. Makesure that the owner shows in your listing.
  7. Take a screenshot of the VM's window showing the ls outputwindow

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Performance Engineering 10th European Workshop Epew 2013 Venice Italy September 17 2013 Proceedings

Authors: Maria Simonetta Balsamo ,William Knottenbelt ,Andrea Marin

2013 Edition

3642407242, 978-3642407246

More Books

Students also viewed these Programming questions

Question

Please list the four ways to distinguish indices.

Answered: 1 week ago

Question

LG4 Understand the different kinds of common stock values.

Answered: 1 week ago