We use a Linux server at sanbox.mc.edu
web pages. Linux is a Unix clone.
For this class, we need only be able to transfer files to the server
so they will be available online. You also have access to the Unix shell,
though its use is optional.
- Sandbox is server which we use to provide web pages to browsers.
- Sandbox runs Linux, a Unix clone.
- It is only necessary only to be able to transfer files to the server,
but knowing a bit about how to use it directly can be helpful.
- Accounts and web service.
- For this class, you will use regular user accounts on Sandbox.
This is different from the web account used in the CSc 114 class.
- Each user has a password-protected account.
- Each account has a home directory for storing files.
- “Directory” is the same thing Windows calls a “folder.”
Just a collection of files.
- Individual home directories keep a user's files together and apart
from those of other users.
- Web directory.
- To publish a file on the web, place it in a sub-directory called
local_html. Files outside of local_html are not
- A new account does not have a local_html; you must create it.
This is needed only once.
- A file called somefile.sometype stored in local_html by
a user someuser is available online by the URL
- If you create a subdirectory (sub-folder) inside local_html, its
contents are also visible online, and the directory name becomes a
component of the URL. If user smith creates a folder
proj under local_html, and places the file
idea.html inside proj, the URL would be
- Transferring files from Windows with WinSCP.
(This is how you make your files
- A common way to place files on a server is using the FTP protocol.
You shouldn't use FTP for this, however. On Sandbox, FTP only works
with the simple web accounts.
- You should use the SFTP or SCP protocols, and
WinSCP is an excellent
client client for them.
- When you open WinSCP the first time, you will see something like this:
- Click New, and fill out the form with the name of the server
(sandbox.mc.edu) and your
account name. You may fill in your password here, else it will ask
you when you push login.
- Push Login. The system will ask for your password if you didn't give
Then it will show you a listing of the files on your account.
- Right-click, choose New, and then Directory. You will get a dialog
asking for the directory name. Type local_html and say ok.
You will now see the new folder in your list.
- WinSCP shows the listing of files in your server folder. You can
navigate it just like the local file system.
- You can transfer files to and from the server by dragging them in
the usual way. The only difference is that WinSCP will raise a dialog
asking if you want to copy the files. Just tell it yes.
- If you wish, on the second screen shown above, you can fill in your
password and push Save. This will save this information on your
computer, and you will be then able to select it from a list on the
first screen, so you won't need to type everything again. You probably
don't want to do this on a public computer.
- An alternative to
- MacOS comes with the command line scp program, which can copy files,
- Like this,
using the Terminal.
- The scp program is not good at creating individual directories, but
it can copy an entire file tree using the -r option.
- You can also Google for graphical SCP clients. There are several free
- Linux also uses scp.
- Using the Unix command line. (This material is optional.)
- Use the free program
putty to connect to Sandbox.
- Double click it. Fill in the name of the computer to connect to,
- Set the protocol to ssh.
- Press Open.
- Sandbox will ask for your login name and password. Note that the
password does not display as you type it.
- It will then show you a command prompt for using the system.
- Change your password.
- To change your password, give the command passwd.
- It will ask for your existing password (to make sure you are you),
and your new password twice (to make sure you can type).
- The new password will be used for both file transfer and login.
- Working with files.
- You can use a text editor to create a file
- Most common one is called pico. Just say pico.
- It's like the Notepad program, but you must use the keyboard for
- Pico shows you the command keys at the bottom of the screen.
The notation ^X means to hold down the control key and press x.
- Listing files: ls for all of them, or ls filename.
- Printing files: lpr filename, or pr filename | lpr
Works from labs on campus. Won't print to your
printer at home.)
- Viewing files: more filename
- Copying files: cp oldname newname.
- Renameing files mv oldname newname. (The mv
stands for “move.”)
- Deleting files: rm filename.
(The rm stands for “remove.”)
- Finding out about commands: man commandname, or
man -k subject to do a search.
- The command shell
always has a “current directory”. The files you view
or create are there.
- When you log in, you are in your home directory. The cd
command will change that.
- Say cd local_html to go to your web directory.
- Use pico to create this file as test.html:
- Point your browser at
- You can create directories with the command mkdir dirname.
- You can move up out of a directory with cd ..