Skip to content

Instantly share code, notes, and snippets.

@sean-cho
Last active June 19, 2018 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sean-cho/3524f85e092c9ce06d89a6d2e3482baf to your computer and use it in GitHub Desktop.
Save sean-cho/3524f85e092c9ce06d89a6d2e3482baf to your computer and use it in GitHub Desktop.
Putty PG2018

MARCC set up for Windows users

Do you have admin permissions to install software on your Windows PC? Navigate to the appropriate section below;


A. With admin permissions

If you have admin permissions to install new software onto your Windows computer, PuTTY provides an MSI Installer that installs both PuTTY and PSCP for you.

A1. Install PuTTY and PSCP

1. Download MSI Installer

  • You can find the installer here.
  • You're likely going to need the 64-bit version, but if you are not sure, refer to this website.

2. Install PuTTY and PSCP using the MSI installer

  • Run the MSI installer and follow the instructions.
  • Enter your admin user/password when prompted.
  • PuTTY and PSCP should be in Start Menu > Programs, or a shortcut to PuTTY will be on your Desktop if you opted to create one during installation.

3. Test installation

Open Command Prompt

pscp --help

## will print the following
PuTTY Secure Copy client
Release 0.70
Usage: pscp [options] [user@]host:source target
       pscp [options] source [source...] [user@]host:target
       pscp [options] -ls [user@]host:filespec
Options:
  -V        print version information and exit
  -pgpfp    print PGP key fingerprints and exit
  ...

A2. Set up PuTTY for MARCC

We will be using the MARCC high performance cluster to perform compute intensive tasks for the workshop. PuTTY will allow you to connect to MARCC remotely.

Briefly, you will have to do the following:

  1. Check your email for a workshop specific userid and password (e.g. john-temp@jhu.edu)
  2. Install Google Authenticator on your phone (iOS / Android)
  3. Add MARCC to Google Authenticator by retrieving and scanning your QR code
  4. Set up PuTTY. (see figure below)
    1. Open PuTTY
    2. Under Host Name (or IP address) enter: {username}@gateway2.marcc.jhu.edu
      • e.g: john-temp@jhu.edu@gateway2.marcc.jhu.edu
    3. Under Saved Sessions enter a name for this session setting: MARCC-PG2018
    4. Save so that you can load this session setting in the future
    5. Click Open
    6. Enter your 6 digit verification code from the Google Authenticator when prompted
    7. Enter your password
  5. You should be connected. Enter pwd. You should see /home-n/{username}
    • e.g.: /home-n/john-temp@jhu.edu (where n is a number from 0 -4)

NOTE: When you type the verification code or password, there will be no indicator tracking your keystrokes. Rest assured that it is being recorded.

Congratulations. You've properly connected to MARCC.

A3. Use PSCP

Here, we will use pscp to securely copy a file from MARCC to your local computer

## Go to Desktop
cd C:\Users\%USERNAME%\Desktop

## Secure copy
pscp {username}@jhu.edu@gateway2.marcc.jhu.edu:work/test.txt PG2018\.
#enter your Google Authenticator key, then password when prompted

## Print contents of test.txt
cd PG2018
type test.txt

B. Without admin permissions

Without admin permissions, you'll have to download PuTTY and pscp separately onto a directory of your choice and then use them from within that directory.

B1. Install PuTTY and PSCP

1. Download PuTTY and PSCP

  • PuTTY.exe and PSCP.exe can be downloaded here.
  • You're likely going to need the 64-bit version, but if you are not sure, refer to this website.
  • Place both executables into a directory named PG2018 on your Desktop.

2. Test pscp

At this point, you've downloaded PuTTY and PSCP, but have not installed them into directories where Windows would look for programs. Therefore, to use them (especially pscp), you will have to do any one of the following:

  1. point to the absolute path
  2. navigate to the directory and use it from within
  3. set a temporary variable everytime you open Command Prompt: this will be particularly useful if you are planning to transfer a large number of files in a single session.

Open Command Prompt and run any single one of the following.

(1). Point directly to pscp

C:\Users\%USERNAME%\Desktop\PG2018\pscp --help

## will print the following
PuTTY Secure Copy client
Release 0.70
Usage: pscp [options] [user@]host:source target
       pscp [options] source [source...] [user@]host:target
       pscp [options] -ls [user@]host:filespec
Options:
  -V        print version information and exit
  -pgpfp    print PGP key fingerprints and exit
  ...

(2). Use pscp from directory

cd C:\Users\%USERNAME%\Desktop\PG2018
pscp --help

(3). Set a temporary variable for pscp

set pscp="C:\Users\%USERNAME%\Desktop\PG2018\pscp"
%pscp% --help

B2. Set up PuTTY for MARCC

We will be using the MARCC high performance cluster to perform compute intensive tasks for the workshop. PuTTY will allow you to connect to MARCC remotely.

Briefly, you will have to do the following:

  1. Check your email for a workshop specific userid and password (e.g. john-temp@jhu.edu)
  2. Install Google Authenticator on your phone (iOS / Android)
  3. Add MARCC to Google Authenticator by retrieving and scanning your QR code
  4. Set up PuTTY. (see figure below)
    1. Open PuTTY
    2. Under Host Name (or IP address) enter: {username}@gateway2.marcc.jhu.edu
      • e.g: john-temp@jhu.edu@gateway2.marcc.jhu.edu
    3. Under Saved Sessions enter a name for this session setting: MARCC-PG2018
    4. Save so that you can load this session setting in the future
    5. Click Open
    6. Enter your 6 digit verification code from the Google Authenticator when prompted
    7. Enter your password
  5. You should be connected. Enter pwd. You should see /home-n/{username}
    • e.g.: /home-n/john-temp@jhu.edu (where n is a number from 0 -4)

NOTE: When you type the verification code or password, there will be no indicator tracking your keystrokes. Rest assured that it is being recorded.

Congratulations. You've properly connected to MARCC.

B3. Use PSCP

Here, we will use pscp to securely copy a file from MARCC to your local computer

## Go to Desktop
cd C:\Users\%USERNAME%\Desktop

## Set pscp variable
set pscp="C:\Users\%USERNAME%\Desktop\PG2018\pscp"

## Secure copy
%pscp% {username}@jhu.edu@gateway2.marcc.jhu.edu:work/test.txt PG2018\.
#enter your Google Authenticator key, then password when prompted

## Print contents of test.txt
cd PG2018
type test.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment