2008/09/20

SSH & SCP for Windows -> PuTTY

For those first-year students still on Windows, I'll post two articles.

The first one is on how to get the SSH-functionality while you're still running Windows, the second one will be (I hope within a week) to post another article - about migrating to Linux.

When you want to access your UvA-home folder and you have only a Windows environment, here's the solution: PuTTY. PuTTY is a program that has the SSH-functionality, and you can simply run it from the Windows-shell (cmd.exe).

I won't give too many details over here - just try to download it, you won't have to do any installation (many people carry PuTTY with them on a USB-stick because of that). The PuTTY SCP program is called pscp.

Download PuTTY here:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

(I hope you know how to use a Windows commandline..)

2008/09/19

SCP (follow-up to SSH)

(If you don't know how to use SSH, first read the previous post)

Another post for the first year students of UvA..

SSH starts a remote shell, enabling you to work on a computer and have full control while you're on the other side of the world (but also if you're sitting next to it, of course). A little downside is, that you - when you're physically on another pc - cannot access your local pc from within the same shell. To move files to and from remote pc's over a SSH connection, there's another tool in Linux, called SCP.

(Before copying anything using scp, you don't have to log in to a ssh server. Of course it is possible to copy anything after logging in, but in that case the "local" file is in reality the "remote" file, and the "remote" file is a file on another "remote" server.

Syntax is quite simple if you're used to ssh:
scp user@host:/path/to/sourcefile /path/to/destinationfile
of course it will work in two directions:
scp /path/to/sourcefile user@host:/path/to/destinationfile
and, instead of destinationfile you'll also be able to specify a directory:
scp user@host:/path/to/sourcefile /path/to/destinationfolder/
use of wildcards is also permitted.
scp user@host:/path/to/sourcefolder/* /path/to/destinationfolder/

So, let's copy a all .txt-files from our UvA-home directory to the directory at the pc I'm now working on:
scp scienceaccount@sremote.science.uva.nl:~/*.txt .
(the last "." stands for "current directory")

Or, copy everything in my UvA-home directory to the directory called "uva_homedir" on the PC I'm right now working on:
scp -r scienceaccount@sremote.science.uva.nl:~/* ~/uva_homedir

SSH

A special post just for our beloved first-year students at UvA :).

It might well happen that you're at home and while having a beer with your dad (or anyone else) you remember you forgot to e-mail your assignment you was working on to yourself. Trouble. You just planned to finish your assignment tonight, but now you left everything you did at the university!

Well, I got some good news for ya: SSH.

On any Linux-pc with a working internet connection, just open a shell and type:

ssh user@host

to open a secured remote shell (where user has to be the user to log in on the remote pc, and host has to be the address of the remote pc).

In case of the University of Amsterdam, user will be your science-account, and host will be sremote.science.uva.nl, so:

ssh scienceaccount@sremote.science.uva.nl

After connecting (this will take about half a minute) you'll be welcomed by the FNWI welcome screen, and asked for your password. While you type in your password, the cursor will NOT move - this is default on UNIX shells.

After logging in, you'll get your bash shell and can access all your files directly. However, the policy of the sremote server requires us to ssh from there to a physical pc - no calculations are allowed at the sremote server (some people have been banned for that).

So, after logging in, choose a pc (ow124, ow125, .. ow141 and so on) and type:

ssh ow124

(because you are already logged in, your current username will be used, and because you're on an internal network you don't have to specify a domain name or something).

From that on, you can perform everything you can on a UvA-PC. Even running graphical programs (nautilus, firefox, try it!).

If the graphical part doesn't work, give SSH the parameter -X (capital x). This will enable X forwarding.

If you're in a Gnome Desktop Environment, you can also select "Connect to Server.." from the "Places" menu. Login credentials:
Service type: SSH
Server: sremote.science.uva.nl
Port: (default, leave empty)
Folder: (default, leave empty)
User name: Your science account user name
Name to use for connection: Be creative :).

After clicking "connect" you will be asked for your password. Now you have your SSH connection integrated in Nautilus!