Changes

Jump to: navigation, search

OPS335 Lab 1

123 bytes added, 09:36, 16 September 2016
no edit summary
<ul><li>You are going to share the public key from the root user in your hostname with the root user of your vm1.</li><li>Make certain you are logged on as '''root'''.</li><li>Copy contents of your '''~/.ssh/id_rsa.pub''' from your host machine, and append the contents to '''~/.ssh/authorized_keys''' on each of your Virtual Machine servers</li><li>Simply issue the Linux command '''ssh-copy-id -i ~/.ssh/id_rsa.pub username@server'''<br><br>In your case: ssh-copy-id -i ~/.ssh/id_rsa.pub root@IPADDR_for_vm1</li></ul>
{{Admon/important|Errors in Copying Public Key from Host to VM|If you experience an error when copying the public key from your hostmachine to your VM, it is most likely caused from not permitting root login that you performed in the previous section. Temporarily set Set to allow login from root for each vm, restart your sshd service and then re-run the above command.}}
<source lang=bash>mkdir -p /backup/vm1
rsync -avz 192.168.x.x:/etc /backup/vm1/ # where 192.168.x.x is the IPADDR of your vm1</source>
 
'''NOTE:''' This command will NOT work if permit root access is denied for your sshd service configuration, so keep it off for now...
<ol><li value="4">If rsync prompts for a password, make certain that you completed the '''SSH key''' section above, and that you assigned the keys for the <u>appropriate user</u><br>(in this case, for the '''root user for both the hostname and vm1'''!)</li><li>When the rsync command runs correctly, you should see all the files from vm1 being copied over to your host machine.</li><li>Run the rsync command again. Notice that the second time nothing is copied over to your host machine since none of the files have changed on your vm1 machine.</li><li>Create a new file in vm1's '''/etc/''' directory, and rerun '''rsync'''. Confirm on your '''host machine''' that only that file that was created on your vm1 machine actually got backed up to your host machine.</li><li>Repeat the above steps to create backups for your '''vm2''' and '''vm3''' machines on your host machine as well (for the respective directories: '''/backup/vm2''' and '''/backup/vm3''').</li></ol>
13,420
edits

Navigation menu