If you use an Apple computer or a computer with a Linux OS, connecting to Ragnar is very easy. All you need is a Terminal program, which Mac OS X and Linux have by default. On Mac OS X, you can find one in the “Utilities” portion of the “Applications” or just type in terminal in the Spotlight search bar. From the Terminal, you can use ssh
and scp
to connect and transfer files. The same commands also work in Linux. If netid
is your user name on Ragnar, type
ssh netid@ragnar.econ.illinois.edu
to connect via SSH. If your user name on your computer and on Ragnar coincide, you can leave out netid@
in the preceding display.
If you want to see X windows, you should use the -Y
and `C’ flags:
ssh -Y -C netid@ragnar.econ.illinois.edu
If you wish you can also set an alias for the login command and make things easier.
You have two options to transfer your files to the servers:
scp
scp
The first one is using the scp
program. For example, to copy the file filename
from your home computer to Ragnar, you would use:
scp filename netid@ragnar.econ.illinois.edu:/home/netid
To copy a file (at home) from Ragnar to your home computer, the process is very similar: you use
scp netid@ragnar.econ.illinois.edu:~/exampledirectory/filename .
The period on the end is important because it tells the computer to put filename in the working directory that you are currently in at home. It can also be a path on your computer.
FileZilla is a free software that allows you to transfer files between your computer and Ragnar. It has a graphical interface and allows to transfer files using simple drag-and-drop procedures.
If you work frequently with Ragnar, entering your password at each login can be avoided with the help of an RSA key. The idea is to generate two key files, a private key for your computer and a public key for Ragnar; these files are then compared automatically when you use SSH. Moreover, SSH keys provide a more secure way of logging into a virtual private server with SSH than using a password alone.
In the Mac OS X Terminal, type:
ssh-keygen
You will be asked to provide a location to generate your RSA keys. The default is
/Users/username/.ssh/id_rsa
where username is the user name on your computer. Next, you will be prompted to enter a pass phrase; this is neither your password for your computer, nor your password for Ragnar, but a third password generated by you. It should have 10 to 30 characters. Mac OS X will then generate your RSA key. In particular, your public key will be in the file
/Users/username/.ssh/id_rsa.pub
Now SSH into Ragnar and make a directory called .ssh in your home directory with
mkdir .ssh
Copy your public key file into this folder and rename it to authorized_keys on Ragnar. To copy and rename in one step, simply log out of Ragnar and enter
scp /Users/username/.ssh/id_rsa.pub <netid>@ragnar.econ.illinois.edu:.ssh/authorized_keys
in the Terminal of your Mac, where the displayed command is meant as a single line separated by a space. Log into Ragnar again and change the file permission of the public key to “read/write by owner only” with the command
chmod 600 /home/netid/.ssh/authorized_keys
The first time you SSH into Ragnar after these changes, you will be asked for the pass phrase for your RSA key. All subsequent logins will be automatic. The same steps also work with Linux, but the directory paths on your computer will most likely differ.