This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

How To

How to use various systems in the department.

Various how-to documents…

1 - Command Line Basics

Getting started with the Unix/Linux command line.

Getting Started

All computer science majors and interdisciplinary majors now take COMP 141, which teaches you about the command line and fundamentals of Unix/Linux. This is primarily aimed at those who have not taken COMP 141, which should become a small number after 2022.

There are many tutorials on the web, just Google around and you will find them. A decent online tutorial is available for example at Linux.org one can also find books on Linux in a bookstore, for those who prefer a hard copy. Linux is derived from Unix, and many of its commands are identical with, or very similar to, older Unix commands. Since Apple's Mac OS X is also derived from a version of Unix (BSD Unix), many of these commands are the same as on a Mac.

Essential Commands

Typically one interacts with a Unix/Linux system using a Command Line Interface (CLI), also known as a Terminal or a Shell. Unless one is using a Desktop Manager on a Linux system, running programs (commands) is by typing on the command line. Some of the more common commands that just about everyone uses are listed below:

  • pwd - "print working directory" prints the name of the current folder
  • ls - list directory lists all the files in the current folder
  • ls -l - long list lists the files along with permissions, creation dates, etc
  • ls -A - list all files in current folder, including the hidden ones
  • cd - change directory moves the current folder back to one's home folder
  • cd <pathname> - change current folder to the one named by <pathname>
  • cd .. - change to the parent folder of current folder
  • mkdir <foldername> - make a new folder (folders are also known as directories)
  • cat <filename> - prints the contents of a text file
  • cat <file1> <file2> > <file3> - joins together text files <file1> and <file2> and puts the result in <file3> (cat - is short for concatenate)
  • less <filename> - lets you scroll up and down through a text file; use Q to quit
  • cp <file1> <file2> - makes a copy of <file1> named <file2> in the current folder; previous contents of <file2> (if any) are lost
  • mv <file1> <file2> - move <file1> to <file2>; used to rename a file (previous contents of <file2> are lost)
  • mv <foldername1> <foldername2> - move <foldername1> to <foldername2>; used to rename a folder name
  • rm <file> - remove a file (delete it)
  • rm -r * - recursively remove all files and folders in the current folder (be VERY careful with this)
  • rm -r <foldername> - recursively remove the folder and all its contents, including subfolders and their files
  • rmdir <foldername> - remove a folder (delete it); the folder must be empty
  • man <command> - shows the manual page for the given <command>
  • passwd - change your password
  • lpr <filename> - print a file; should work with text, postscript, and .pdf files.
  • lpq - show status of printer and print jobs
  • lprm <printno> - remove a printer job from the queue
  • a2ps - anything to postscript this (if installed) converts a file into postcript and then prints it; gives nicer formatting for text files
  • nano - edit a text file with a user friendly interface
  • pico - edit a text file (usually pico and nano are equivalent)
  • nano <filename> - edit the named file
  • vi <filename> - the old Unix visual editor; see the man page for help
  • emacs <filename> - edit with the GNU Emacs editor; see the man page for help
  • exit - quits the current Terminal session; CTRL-D often does the same
  • ping <URL> - see if an IP address is answering
  • who - see who is logged on
  • whoami - see who you are (for the existentially challenged)
  • top - show the top running processes in a list, with process numbers
  • kill <number> - kill a process number (you have to own the process)
  • finger <name> - show stats for the user <name>; with no <name> finger shows stats for all current users

Note that by default you are positioned in your home folder after signing in. The file system is a tree with root at /, so to view the entire file system start by typing cd followed by ls and so forth. Pathnames are separated by forward slashes, so for example a file named whosis in your home folder /home/myuserid has pathname /home/myuserid/whosis. You can always refer to files by their fully qualified pathnames, but lacking the full pathname the system will look for the file in the current folder. Note that CTRL-C often cancels the current process, and CTRL-D often serves as an End of File marker. All of the above merely scratches the surface; see external documentation for further particulars and advice.

Why learn Linux?

Because Unix and its offshoots remains one of the most important operating systems for servers, and many networking concepts are rooted in Unix for historical reasons. Because Unix/Linux systems are efficient, fast, and highly stable. Because Unix/Linux is powerful: check out wildcards, regular expressions, pipes, redirecting input and output, shell scripts, and cron jobs for starters. There are some very cool ideas here for the cognoscenti that just don't in the Windows world (or are unwieldy when transplanted there). Linux is open source software.

Trying Linux

For those who want to try it out on your personal laptop or desktop, find a decent Linux distribution such as Ubuntu, download and burn the installation CD for your hardware, and boot from the CD. This will give you a working version of Linux running from the CD (slow) that can be played with. You can also choose to install Linux on your hard drive next to the existing OS (a dual boot approach) so that you can choose the OS at boot time, or choose to install Linux in place of your existing OS.

2 - Getting Help

This page describes how to get help.

E-mail

Please direct all inquiries to Miao Ye (helpdesk@cs.luc.edu).

Microsoft Teams

Please join the Loyola CS Systems group on Loyola’s Microsoft Teams effective after Jnaury 1, 2022.
This is available to Loyola faculty, staff, and students only.

3 - Remote Access

Remote access to systems in our department.

All users of our systems can access their files remotely; however, we currently do not provide general support to students or faculty for Samba and CIFS shares (i.e. mounting as a Windows drive) owing largely to security and usability considerations. (There is a legacy Samba setup; however, no support is provided.) There are a number of alternatives to Windows shares that we do support and consider effective for most needs.

sshfs

If you are a Linux or Mac user, you can use the Secure Shell Filesystem client, which makes use of the Fuse project. Linux users can simply install the sshfs package (e.g., on Ubuntu: apt-get install sshfs). The Dokan project on Windows provides the same capabilities as sshfs on Linux and the Mac.

Secure FTP (sftp)

Most Secure Shell clients have the ability to upload/download files. If you are looking for something that is less transparent than a typical filesystem and can live with an upload/download model, this might be all you need (and seemingly, is what most of our users want).

Version Control Systems

We recommend that all of our students learn how to use the Concurrent Versioning System (CVS) or Subversion, especially for programming classes. Source code management is available through command-line tools or nicely integrated into many development environments, such as Eclipse and NetBeans (even Visual Studio supports Subversion through the AnkhSVN add-in). The TortoiseSVN and TortoiseHg clients for Windows are particularly nice!

Gnome and KDE

If you are an Ubuntu desktop user at home, both of these UIs allow you to connect to a remote place via SSH and browse folders as part of the UI's shell (that is, you don't need to go to the dreaded terminal). In Gnome, Places -> Connect to Server will allow a user to connect to a ssh server and will then treat that connection to your home directory like a mounted drive.

PuTTY and Cygwin

Speaking of SSH access, Windows users are encouraged to use the PuTTY or Cygwin support for SSH. There are a number of good commercial solutions but these cost big money (between $75-$100) and are not likely to be cost effective (let alone necessary) for most members of our community.

Unison

Unison is an excellent 2-way file synchronization tool. It supports all platforms.

4 - Secure Shell

Getting started with SSH/Secure Shell at Loyola.

Not all computer systems in the department are intended for general use, and some are restricted to faculty and staff usage. (And many are reserved for testing purposes.) The systems available for general use include random.cs.luc.edu and infinity.cs.luc.edu.

By default, SSH traffic (on port 22) is blocked outside of Loyola. You will need to use the VPN or the public key authentication to connect to our servers on an alternate port (22222).

For most of our user community, we think the VPN is a reasonable solution. If you don't have access, please let us know. We can get VPN access for alumni and collaborators.

Configuring SSH in General

To use public key authentication (PKA), you need to make a configuration after you install a ssh client, which includes three steps:

  1. generate a private and public key pair (Key Type: RSA Key Length: 1024);
  2. store private key in your local computer;
  3. save public key on the remote Linux server.

In the remaining sections, we discuss different configurations that are commonly needed by faculty, staff, and students within our department.

Bitvise Tunnelier

Two Quick Steps to Configure SSH Keys Authentication With bitvise SSH client

  1. Download ssh client software from http://www.bitvise.com/download-area
  2. Generate a private and public key pair:
    • click the link titled 'User keypair manager' in the Login tab.

    • click the button [Generate New ...]

    • choose ssh-rsa and 1024bits

    • you can enter passphrase or leave it empty

    • click the button [Generate]

      This passphrase is not sent to the remote host, and it is only used to protect your private key. Otherwise, anyone who has access to your private key can authenticate to your account automatically.

  3. Export Public key to the Linux server User keypair manager.
    • click the keypair in the slots

    • click the button [Export..]

    • chose "Export public key" and "OpenSSH format"

    • click the button [Export]

    • It should be something like:

      ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAo8q0r4d599buYHCbc36ViJniRuLvUr++asdSUh
      
    • You need to append that line to ~/.ssh/authorized_keys on the Linux server.

OpenSSH on Linux, Mac OS X, or Cygwin

  1. Generate a private and public key pair

    ::: literalinclude openssh-keygen.txt :::

  2. Save Public key on the Linux server

    ::: literalinclude openssh-savekey.txt :::

    You need to append that line to ~/.ssh/authorized_keys on the Linux server

  3. connect to the Linux server:

    $ ssh -p port-num  xyz@server.cs.luc.edu
    

    where xyz is your username on our Linux system. The port-num and server name have been sent to your Loyola mailbox with your username and password.

PuTTY

Five Quick Steps to Configure SSH Keys Authentication With PuTTY

  1. Download ssh client software:
  2. Generate a private and public key pair
    • Double click PuTTYgen.exe, press [Generate] button, keep moving mouse. Once the keys are generated, enter a passphrase for your private key, or leave the boxes empty if you do not want to protect your private key with a passphrase.
    • This passphrase is not sent to the remote host, and it is only used to protect your private key. Otherwise, anyone who has access to your private key can authenticate to your account automatically.
    • Click [Save Private key] button to save it in a file, say, C:\ppp.ppk
  3. Save Public key on the Linux server
    • cut/paste your public ssh key (Please see the figure in the web page mentioned in the beginning) on ONE LINE (That is very important!!!) in a file,

    • Do not add the rsa-key-20090614 at the end. Make sure, there is ssh-rsa at the beginning.

    • It should be something like:

      ssh-rsa ... 3434343234232m/PmcZJc5uVleXfp6yJIWG5xJE9TpY1VC4n/NQlWs1PTcplk5+xhUJPHjeMkKcVMIhhUGg0l+Tt08
      
    • You need to append that line to ~/.ssh/authorized_keys on the Linux server.

  4. Store Private key in PuTTY SSH authentication agent
    • Start the PuTTY SSH authentication agent PAGEANT.EXE (double click the icon).
    • After it started, right-click its syspanel icon (in the right-bottom corner of your screen)and select "add key". Select your private key file, say C:ppp.ppk, and type in your passphrase. The Pageant works as a passphrase keeper.
  5. Use PuTTY to connect to the Linux server
    • Under "Host name or (IP address)" enter hostname
    • Under "Port", enter port number
    • The port number and hostname have been sent to your Loyola mailbox.
    • Then, click [Open]

This is adapted from http://www.howtoforge.com/how-to-configure-ssh-keys-authentication-with-putty-and-linux-server-in-5-quick-steps

SSH Communications

Five Quick Steps to Configure SSH Keys Authentication With ssh Client from SSH Communications

  1. Download ssh client software from:

    - http://www.colorado.edu/its/docs/authenticate/printouts/win_ssh.html
    - http://www.sfsu.edu/~helpdesk/ssh/ssh329/
    
  2. Generate a private and public key pair

    • In the toolbar of ssh client, there are several icons. First from left is "Save", and second is "Print". The third from RIGHT, is "Settings".
    • Click "Setting" icon.
    • In the "Setting" windows, go to "Global Settings"->"User Authentication"->"Keys".
    • Click "Keys".
    • Under "Key pair management", click "Generate New", then click Next.
    • In the "Key Generation" window that appears:
    • From the drop-down list next to "Key Type:", select RSA
    • From the the drop-down list next to "Key Length:", select 1024.
    • Click Next. The key generation process will start. When it's complete, click Next again.
  3. Store private key

    • In the "File Name:" field, enter a name for the file where SSH Secure Shell will store your private key. Your public key will be stored in a file with the same name, plus a .pub extension.
    • In the boxes next to "Passphrase:", enter a passphrase for your private key, or leave the boxes empty if you do not want to protect your private key with a passphrase.
    • This passphrase is not sent to the remote host, and it is only used to protect your private key. Otherwise, anyone who has access to your private key can authenticate to your account automatically.
    • click Next, and then Finish.
  4. Save Public key on the Linux server

    • Under "Public Key management", click "View". Notepad or another editor will open xxx.pub You may save it in a file. Then, you need to append that file to ~/.ssh/authorized_keys on the Linux server.

    • You may need to add ssh-rsa at the beginning of the key and edit it to make the key on one line, ex.:

      ---- BEGIN SSH2 PUBLIC KEY ----
      

      Comment: "[2048-bit rsa, cs@luc-cs-101, Thu Jul 29 2010 01:16:06]" ssh-rsa AAAAB3NzaC1yc25A4vaINWk8i8vRAYOWoPacCP8KU3NUqWExy2a6lUq75F3pYmg46cjZ8gj9aEVcGgAwGgo4XP4TBB ---- END SSH2 PUBLIC KEY ----

  5. Use ssh client to connect to the Linux server

    • "Host Name:" to hostname
    • "Port Number:" to port number
    • "Authentication Method:" to Public Key.
    • The port number and hostname have been sent to your Loyola mailbox with your username and password.
    • You will be prompted for the passphrase for your private key (if you supplied one). If you did not supply a passphrasefor your private key, you will not receive a request for a passphrase when connecting to the remote host.
  6. See http://kb.iu.edu/data/amzx.html for additional details. We have adapted our instructions from this page.

Cygwin SSH Installation

  1. go to http://www.cygwin.com/setup.exe
    • This will download a GUI installer called setup.exe which can be run to download a complete cygwin installation via the internet.
  2. Download Source
    • Please choose [Install from Internet] option, setup.exe creates a local directory to store the packages before actually installing the contents. The Root Directory for Cygwin (default C:cygwin) will become / within your Cygwin installation.
  3. Choosing Packages
    • Activate the window [Select Packages]
    • enter ssh in [search] box
    • click [+] Net ...
    • click []Skip openssh ...n
    • then click [Next] .…
  4. After installing Cygwin/openssh, you can configure OpenSSH for Public Key Authentication