CS代写 COMP30023 Week 01 – Prelab Part 2

COMP30023 Week 01 – Prelab Part 2

School of Computing and Information Systems
COMP30023: Computer Systems

Copyright By PowCoder代写 加微信 powcoder

Week 01 – Prelab Part 2
Once you have received your IP address from the comments of the LMS assignment, you should try to
connect to your VM.

1 Connecting to remote server using SSH
You will be connecting to your Virtual Machine (VM) instance using the SSH protocol. You will use
your private key (created in the previous section) to authenticate with the server. You will also need
the IP address of your instance which was sent to you.
We assume that you will be using your Linux VM to complete this and future lab exercises.
Let’s get connected!

If you are not on campus, you may need to connect to a University VPN (see https://studentit.
unimelb.edu.au/wireless-vpn/vpn).
If you have an internal VM IP address (172.16.0.0 – 172.31.255.255) because you indicated that you are
currently in Australia, use the general (Cisco AnyConnect) VPN.
If you have an external VM IP address (not within the 172.16.0.0/12 range – see above) because you
indicated that you are not currently in Australia and you are in Mainland China, use FortiClient.
Otherwise, you may use the general (Cisco AnyConnect) VPN.

1.1 The OpenSSH client
You can use the following command to directly log in to the remote instance.
$ ssh -i

If successful, you should see a welcome message.

If you get a “Permissions 0xxx for ’’ are too open” error.
Execute the following to set the private key to be only readable by the owner of the file (*nix only).
$ chmod 600

If you are using WSL (Windows Subsystem for Linux), e.g. Ubuntu, you should move or generate the
private key under the WSL home directory ( cd ~ ), and not a directory shared with Windows (e.g.
/mnt/c/… ), because Windows’ file system does not support Unix permissions.

1.1.1 What is ?

It is the path to your private key file on your filesystem.
If you have followed the instructions of Part 1 precisely, it should be ~/_key for
*nix or C:\Users\\_key for Windows.
Alternatively, you may cd into that directory, after which you can simply specify
_key after -i .

Note: You will be assumed to have access to your allocated VM upon the completion of this prelab.
Unless otherwise stated, you’ll be expected to use your VM for all practicals.
Though you are welcome to find methods to complete activities on your local machine and seek help on
the discussion forum or ask demonstrators in workshops, we do not guarantee support in this regard.

https://studentit.unimelb.edu.au/wireless-vpn/vpn
https://studentit.unimelb.edu.au/wireless-vpn/vpn

1.2 SSH config (optional, for convenience)
It may be somewhat annoying to type out (or copy-paste) the entire ssh command each time. To save
time, a SSH config file can be created and used to specify SSH hosts as well as options for each host.

1. Create a .ssh directory under your home directory, if it doesn’t already exist.
*nix: $ mkdir -p ~/.ssh
Windows: $ mkdir %HOMEPATH%\.ssh

2. Copy both your public key and private key into the .ssh folder. e.g.
*nix: $ cp _key _key.pub .ssh/
Windows: Using File Explorer or similar commands

3. Create a file called config inside the .ssh folder with the following contents.

Host comp30023
HostName
IdentityFile
User

Host comp30023
HostName 115.146.92.110
IdentityFile ~/.ssh/stevent2_key
User stevent2

How to create this file (Example)?

• Linux: vim or your preferred text editor

(a) $ cd ~/.ssh && touch config && open config
(b) Open the Format menu, if you see “Make Plain Text”, click it.

If you see “Make Rich Text”, do not click it.
(c) Type in the contents

• Windows:
(a) Open Notepad
(b) Type in the contents
(c) File -> Save, browse to the .ssh folder that was created (e.g. C:\Users\steven\.ssh )
(d) File name: “config” , Save as type: All files

Important: do not remove the quotation marks, or you’ll be saving a .txt file.
(e) If you get errors like “Bad owner or permissions on …config”, ask your demonstrator.

If you’re experiencing this issue outside class time, you should rename config to another
name and ask your demonstrator to help you debug this during your next class.
Use the ssh -i command in the mean time.

If you get ”Bad owner or permissions on ~/.ssh/config” on *nix (not Windows). Execute commands1:

$ chmod 600 ~/.ssh/config
$ chown $USER ~/.ssh/config

You should now be able to access your VM with the command:
$ ssh comp30023

1https://serverfault.com/questions/253313

https://serverfault.com/questions/253313

Connecting to remote server using SSH
The OpenSSH client
What is ?

SSH config (optional, for convenience)

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com