ACCRE manages two servers (
tncred2) running Stata Server where permitted users can log in and run analysis on TN Cred data. Follow the appropriate link below (depending on whether you are a Windows or Mac OSX user) for instructions for accessing these servers. Note that you must have special permission from Monica Hernandez (email: email@example.com) in order to access the servers.
Required Software for Windows
- PuTTY: PuTTY is a free program that allows you to remotely log in to a Linux server using a utility called Secure Shell (ssh). You can download PuTTY on this page. You’ll want to scroll down to the Binaries section and click the putty.exe link under the For Windows on Intel x86 heading. Clicking that link will download a binary file that you can run directly (no need to run an installer). After downloading the .exe file, we recommend navigating to your Downloads folder, where you should see the putty.exe file, and then copying it to your desktop so you can easily access it.
- Xming: Xming is a free piece of software that will allow you to interact with the remote Stata software through a graphical interface that you are likely accustomed to if typically run Stata from your laptop/desktop. Download the installer for Xming from this page. Once you have downloaded the setup .exe file, click on it to begin the installation. During this process you will be asked questions about where you want to install the software, if you want desktop icons, etc. We recommend accepting all the default options, with the exception of clicking the boxes that give you convenient desktop icons for XLaunch and Xming.
- WinSCP: WinSCP is a free piece of software that enables you to easily copy files (e.g. your Stata workspace) to and from the tncred servers. Download the installer for WinSCP on this page. Click the link that reads Installation Package to begin the download, then click on this file once it’s finished downloaded to run the installer. Accept all the default installation options until the installation completes. You should see a WinSCP icon on your desktop once you have completed the installation process.
Logging Into the Servers on Windows
Launch PuTTY by double clicking on the desktop icon. You will probably see a message from Windows telling you that the publisher of this software could not be verified. Click Run anyways and uncheck the Always Ask dialog box to prevent this message from appearing each time you run the software. A PuTTY Configuration window will pop up. On the left side of the window under Connection you will see a SSH option with a “+” symbol to the left. Click the “+” symbol to expand, and then click the X11 option. The window should now read Options controlling SSH X11 forwarding. Check the box beside Enable X11 Forwarding. Now scroll up on the left menu and click on Session at the very top of the menu. Fill out the Host Name and Saved Sessions boxes to be consistent with the image below (IMPORTANT NOTE: you should replace “tncred” with either “tncred1″ or “tncred2″, depending on which server you have been assigned to), and then click Save in the Saved Sessions section. You should now see tncred listed under Default Settings, so the next time you open PuTTY you can click tncred and then Load to load the settings you have changed for these types of sessions. Finally, click Open at the bottom of the window to log in to one of the tncred servers. If this is your first time connecting, you will likely get a message along the lines of “The server’s host key is not cached in the registry…” Click Yes indicating that you trust the host. You will then be prompted for your username and password. Note that for security reasons your password will not appear as you are typing. Continue typing your password and hit Return/Enter when you are done. If you are successful, you will be dropped into a Linux “shell” with a line containing your username, the server name, and a command prompt.
To test that Xming is installed and working correctly, try typing xeyes on the command prompt and hitting Enter/Return. You should see a Xming window appear with two eyes that follow your cursor (see image below for an example). If you do not see the eyes appear in a new window, exit PuTTY by typing exit on the command prompt. Double-check that Xming is running (double-click the Xming desktop icon to start Xming; you may need to do this if you have re-booted your machine since last using Xming), log into a tncred server via PuTTY (verify that the “Enable X11 Forwarding” box is checked), and then type xeyes again to see if the window now appears. If it does not, open a helpdesk ticket requesting assistance.
Copying Files To and From
tncred Servers on Windows
Double-click the WinSCP desktop icon. After entering the host name (tncredX.accre.vanderbilt.edu, where X is either 1 or 2), your username, and password, click Login at the bottom of the window. The first time you are trying to connect you will likely get a “Continue connecting to an unknown server and add its host key to a cache?” message. Click Yes to indicate that you trust the host. Once you are connected to WinSCP, you will see files on your local machine (i.e. laptop or desktop) on the left side of the window and files in your home directory on the tncred server on the right side of the window. Navigate to the file, then drag and drop it to the appropriate directory in the opposite window to create a copy of the file. Files can be moved in either direction.
Running Stata on Windows
Once you are logged into one of the tncred servers and you have confirmed that X11 forwarding is working by running xeyes, you are ready to launch Stata. Note that xeyes is not an important piece of software, this is just a simple program that tests whether X11 forwarding is working, enabling you to run Stata from a graphical user interface. In other words, once you have verified that xeyes is running, you can close the xeyes window and you do not need to run the program again.
To launch Stata, simply type the following on the Unix command line provided by PuTTY and hit return/enter:
A Stata graphical user interface should now appear.
Required Software for Mac
- XQuartz: XQuartz is a free piece of software that will allow you to interact with the remote Stata software through a graphical interface that you are likely accustomed to if you typically run Stata from your laptop/desktop. Download the installer for XQuartz from this page. Once you have download the .dmg file, double click on the file to begin the installation. Note that XQuartz should work with Mac OS 10.6 or later.
Logging Into the Servers on a Mac
You will be logging into the servers using a command line utility called ssh. To open a terminal session navigate to Applications -> Utilities -> Terminal.app (you might even drag this application to your dock for quick access). To access one of the servers type:
ssh -X firstname.lastname@example.org
Replace userid with your assigned user id for accessing the tncred servers (this should be something like tcX, where X is an integer). Depending on which server you’ve been assigned to, you may need to change the hostname to tncred2 instead of tncred1. If this is the first time you have logged in to this server, you will see a message that looks similar to the following:
The authenticity of host 'tncred1.accre.vanderbilt.edu (22.214.171.124)' can't be established. RSA key fingerprint is XXX. Are you sure you want to continue connecting (yes/no)?
Type yes (indicating that you trust the connection) and hit enter/return. You will then be prompted for your password. Enter your password and hit enter/return. Note that, for security reasons, as you are typing your password it will not appear on your screen. Just continue typing and hit enter/return once you have completely typed out your password. If your password is accepted, you will be logged in to one of the tncred servers, and you should see a command prompt that resembles the following:
To test that XQuartz is installed and working correctly, try typing xeyes on the command prompt and hitting enter/return. You should see a XQuartz window appear with two eyes that follow your cursor (see image below for an example). If you do not see the eyes appear in a new window, log out of the server by typing exit on the command prompt. Double-check that XQuartz is installed. If the window below does not appear after double checking that XQuartz is installed on your computer and you have followed the instructions above closely (make sure to include the -X option when logging in with ssh), open a helpdesk ticket requesting assistance.
Copying Files To and From
tncred Servers on a Mac
You can use another command line utility called sftp (which stands for “secure file transfer protocol”) for copying files to and from the tncred servers. You’ll first need to open a terminal session (Applications->Utilities->Terminal.app). Once you have a terminal session open, type the following to initiate a sftp session (in these examples we’ll assume we are copying files to/from tncred1, but we could just easily use tncred2 instead):
Replace userid with your assigned user id for accessing the tncred servers. You will be prompted for your password to log in to tncred1. After typing your password, you will be dropped into an interactive sftp session (as indicated by the sftp> command prompt). From this session, you can run normal Linux commands like ls, cd, mkdir, and rm. These commands will be executed on the remote server (e.g. tncred1). To run a command on your laptop or desktop machine, simply put the l character in front of the command (e.g. lls, lcd, lmkdir, or lrm). First, here’s an example for copying a file (called myFile.txt) from your local machine to the tncred1 server:
sftp> put myFile.txt
This example assumes that the file myFile.txt is in your home directory on your local machine (e.g. laptop). If it is not, you will need to move to the appropriate directory using the lcd command. For example, if this file were in a subdirectory in your directory called myDir, then you could move to it using the lcd command:
sftp> lcd myDir sftp> put myFile.txt
Both of these examples will copy the file to your home directory (/home/userid, where userid is replaced with the appropriate user id you have been assigned). If you would like to copy the entire contents of a directory to a tncred1 server, you will need to first create a new directory on tncred1 and then copy all the files from the directory with the wildcard (*) character. For example:
sftp> mkdir myDir sftp> cd myDir sftp> lcd myLocalDir sftp> put *
To copy data from the server to your local machine, use the get command:
sftp> get file.txt
This command copies a file called tncred.txt from your home directory on tncred1 to your current directory on your local machine (your current directory will be your home directory on your local machine unless you have switched directories with the lcd command). Simply type exit when you are ready to exit the sftp session.
Running Stata on a Mac
Once you are logged into one of the tncred servers and you have confirmed that X11 forwarding is working by running xeyes, you are ready to launch Stata. To do so, simply type the following on the command line and hit return/enter:
A Stata graphical user interface should now appear.