{
"video": "xb8B-8OAVL0",
"seconds": 131,
"title": "Grant Professor Access to your VM",
"prior": ["Create Compute Instance","Connect to Oracle Cloud VM Mac","Connect to Oracle Cloud VM"],
"transcript": "In this video, we'll see how to allow another person to connect to your virtual machine as a particular user. I'll assume you already have a virtual machine running and that you're able to connect to it to execute commands. If not, check out the videos listed above.\r\n\r\nOn my VM, I'm already logged in using an RSA public-key-private-key pair. In a prior video, I configured my local computer to use my private key to allow secure access. \r\n\r\nNow, let's look at the public key used on the remote VM. I'm already logged on to my cloud machine as the OPC user and in my home directory. To work with the necessary authentication files, I'll switch to the \".ssh\" folder.\r\n\r\nA listing shows that I have a single file called \"authorized keys.\" Let's take a look at the contents. This file contains a single public key. It was generated and placed in here when I originally provisioned this machine. Its associated private key is what allows me to access this machine remotely. \r\n\r\nNow, I want to configure this machine to allow my professor to log in as the opc user to help me configure my machine and to grade my work. To do that, he'll need a private key that matches a public key listed in the \"authorized keys\" file for the opc user. I won't share my private key with him because, well, it's private. You should never share your private key with anyone. Instead, I need to put my professor's public key in this file. Then he can authenticate as the opc user using his private key.\r\n\r\nFortunately, he published his public key in a web-accessible location. I'll use that URL and w-get, to look at his public key.\r\n\r\nThat command only displayed the key to the screen. I'll need to append it to the \"authorized keys\" file by running the command again and redirecting its output to the end of the file.\r\n\r\nThat's all there is to it. Let's display the file contents again so we can see that both public keys are now included. \r\n\r\nNow, my professor can log in securely too.\r\n",
"code": [
{
"summary": "Commands",
"detail": "pwd\r\n\r\ncd .ssh\r\n\r\nls -al\r\n\r\ncat authorized_keys\r\n\r\nwget -qO- https:\/\/filedn.com\/lOHnphPm3vnROy2M4FmMMtR\/linux\/gove_allen_id_rsa.pub\r\n\r\nwget -qO- https:\/\/filedn.com\/lOHnphPm3vnROy2M4FmMMtR\/linux\/gove_allen_id_rsa.pub >> authorized_keys\r\n\r\ncat authorized_keys"
}
]
}