SSH Tutorial System Commands

System Commands
2 Mar 202421:16

Summary

TLDRThis tutorial provides a step-by-step guide on logging into a virtual machine using SSH keys for enhanced security, as password logins are disabled. It covers key generation on Linux, Unix, Mac, and Windows systems, including WSL, and demonstrates how to submit the public key for access. The video also navigates through the virtual machine to show how to read instructions, solve assignments, and use evaluation scripts to check and submit solutions, ensuring a comprehensive understanding of the process.

Takeaways

  • 🔑 You can no longer log into the virtual machine using passwords; SSH keys are now required for security.
  • 💻 For Linux, Unix, Mac, or Windows with WSL users, follow specific instructions to create SSH keys.
  • ⚙️ Use the 'ssh-keygen' command to generate a public and private key pair on your local system.
  • 🗂️ By default, the key files are stored in the home directory under the '.ssh' folder.
  • 🔑 The public key should be copied and uploaded to the server for authentication.
  • 🌐 Log into the specified website using your student email to submit the public key.
  • 💻 For Windows PowerShell users, different instructions are provided to generate and use SSH keys.
  • 📝 After generating the SSH keys, log into the virtual machine using the provided SSH command.
  • 📄 Always read the 'readme.md' file in the virtual machine for important instructions and assignment details.
  • 📂 Navigate to '/opt/se21' to find assignments, and use 'Synchro eval' to evaluate your solutions.

Q & A

  • Why can't I log into the virtual machine using passwords anymore?

    -Passwords are no longer used for logging into the virtual machine due to security measures. SSH keys are now the required method for accessing the virtual machine.

  • What are the prerequisites for logging into the virtual machine using SSH keys?

    -To log in using SSH keys, one must first create a pair of SSH keys (public and private) on their local system and then submit the public key to the server.

  • Can I use the same method to create SSH keys on both Linux/Unix/Mac and Windows?

    -The method for creating SSH keys is similar across Linux, Unix, Mac, and Windows with WSL. However, Windows users without WSL or using PowerShell will follow a slightly different process.

  • What command should I use to generate SSH keys on Linux or Unix?

    -On Linux or Unix, you can open a terminal and type 'ssh-keygen' to generate a public and private key pair.

  • What is the default location where the SSH keys are stored after creation?

    -By default, the SSH keys are stored in the '~/.ssh' directory of your home folder with the filenames 'id_rsa' for the private key and 'id_rsa.pub' for the public key.

  • Is it mandatory to set a passphrase for the SSH key?

    -Setting a passphrase for the SSH key is optional. It adds an extra layer of security, but for simplicity, it can be skipped by pressing enter when prompted.

  • How can I verify that my SSH keys have been created successfully?

    -You can verify the creation of SSH keys by navigating to the '~/.ssh' directory and using the 'ls' command to check for the presence of 'id_rsa' and 'id_rsa.pub' files.

  • What should I do with the public key after it's created?

    -The public key should be copied and pasted into the form provided on the server's website to allow you to log in to the virtual machine.

  • How do I log into the virtual machine for the first time using the SSH key?

    -After uploading the public key to the server, you can log in by using the command provided, which includes your role number and the server's address. The system will prompt you to trust the domain and then log you in automatically.

  • How can I navigate and solve assignments inside the virtual machine?

    -Inside the virtual machine, you should first read the 'readme.md' file for instructions. Assignments are located in '/opt/se21', and solutions should be written in a 'script.sh' file within a folder in your home directory corresponding to each assignment.

  • What command should I use to evaluate and submit my solution for an assignment?

    -To evaluate and submit your solution, you should use the 'synchro eval' command. It will provide feedback on the correctness of your script and confirm successful submission.

  • What is the purpose of the 'synchro eval' command in the context of the virtual machine?

    -The 'synchro eval' command is used to evaluate whether the script written for an assignment meets the requirements. It checks the script against predefined test cases and confirms if the submission is successful.

  • How can I make sure that my script is executable?

    -To make your script executable, you need to run the command 'chmod u+x script.sh' in the terminal, where 'script.sh' is the name of your script file.

  • What should I do if 'synchro eval' returns an evaluation fail?

    -If 'synchro eval' returns an evaluation fail, you should review the error message provided for clues on what might be wrong with your script. Common issues include the script not being executable or not meeting the assignment's requirements.

  • How can I view files with colors and in a paginated format?

    -You can use the 'bat' or 'cat' command followed by the name of the file to view files with colors. The output will be displayed in a paginated format for easier reading.

  • What is the recommended order for solving assignments and practice questions in the virtual machine?

    -The recommended order is to first solve the assignments in the order they are presented, and then proceed with the practice questions week by week, starting with the lowest numbered practice question and moving upwards.

Outlines

plate

此内容仅限付费用户访问。 请升级后访问。

立即升级

Mindmap

plate

此内容仅限付费用户访问。 请升级后访问。

立即升级

Keywords

plate

此内容仅限付费用户访问。 请升级后访问。

立即升级

Highlights

plate

此内容仅限付费用户访问。 请升级后访问。

立即升级

Transcripts

plate

此内容仅限付费用户访问。 请升级后访问。

立即升级
Rate This

5.0 / 5 (0 votes)

相关标签
SSH KeysVirtual MachineLogin TutorialLinuxMacWindowsSecurityKey GenerationITM StudentsSystem Commands
您是否需要英文摘要?