SE250:working from home

From Marks Wiki
Jump to navigation Jump to search

It is relatively easy to set up your home computer to be able to do the 250 work from home. Here are some quick tutorials that should help in getting rid of reliance on the uni computer labs.

Connecting to UoA via SSH

You can connect to the university linux servers from home, much like you do in the uni labs. This allows you to compile and execute code on them, and access your uni data.

Windows SSH software

There are two main ways to get SSH functionality on windows. You can add openSSH to cygwin, which will be covered in the cygwin section, or you can download a standalone client. One of the best clients for windows is PuTTY, and its shell is often more useful than the standard cygwin bash shell, so i recommend you use it.

PuTTY

To get PuTTY, download the windows installer here

Once it has downloaded, run the installer. All the standard options should work fine.

Once PuTTY is installed, start it. It should bring up a dialog box. All you need to do in this is type in the server address(see section on uni linux servers), and click open. Note that you do not need to prefix the address with "<username>@". Unlike some other ssh clients, Putty will prompt you for your username as well as your password.

OpenSSH

After installing cygwin and openSSH, all you need to do to is open your cygwin bash shell, and enter this command:

ssh <username>@<server address>

The server will prompt for you for your password. Enter it, and press return.

Note:

  • The first time you connect to a server with a specific client, the client will ask you if you want to trust this server. Just accept this(assuming you are connecting to a server you trust).

Linux SSH Software

To use SSH on linux, start your favorite terminal/shell, and enter this command:

ssh <username>@<server address>

If you don't have a ssh installed, your shell will complain. If it does so, then you will need to install it. There are many ways of doing this, but most systems have a package manager. Start this, and search for ssh.]

If you have debian based linux, for example Ubuntu, you can most likely use apt to install it. Just run this command:

sudo apt-get install ssh

Note that it is always a good idea when using apt to update your package lists and system first:

sudo apt-get update
sudo apt-get upgrade

Uni Linux Servers

The linux server used in the labs is login.cs.auckland.ac.nz. However, this seems to be horribly slow when being access from outside uni, so if you find this, try using shell.ece.auckalnd.ac.nz.

Finding Your Files

When you log into the linux server, it takes you to your unixhome drive(as linux is a unix system). However, most people have their files on the echome drive, as this is the one mounted when you log in on windows. To get to echome, type:

cd ../echome

In general, when navigating a linux machine with the command line, these commands are very useful:

  • To change your current directory, use:
cd <directory>

You can navigate through one directory at a time, by entering the directory, or string a series of directories together with the forward slash(not backslash, which is used in windows).

eg:

cd year2
cd 250
cd lab1

or

cd year2/250/lab1
  • To see what is in your current directory, use the command "ls". This will display files and folders.
  • To move "up" a directory, use:
cd ../
  • To return to your home directory, use:
cd ~/

Uploading/Downloading Files

There are GUI interfaces for downloading and uploading files via ssh(or rather scp or sftp), but you can also do so via the comand line.

The easiest method uses "scp", which is the secure version of the cp, or copy, command. You must run these commands from a standard shell, not from within a ssh session. It does not matter if you have a current ssh session running in another shell, however.

Upload a file:

scp <source file> <username>@<server address>:<destination file>

The <source file> and <destination file> parameters must contain the directory route to the files, from your current directory and your home directory on the server, respectively. For example, to upload the file test.c from my current directory on my home computer to where i store my 250 files, i would use:

scp test.c bvic005 AT shell.ece.auckland.ac.nz:../echome/year2/250

This will prompt for my password, and assuming it is entered correctly, the file will be uploaded.

Downloading a file is essentially the same, but the with the server address before the source file, rather than the destination file, as the source file is now the one on the server:

scp <username>@<server address>:<source file> <destination file>

Installing cygwin

coming soon!

Installing Emacs

coming soon!