How to access Stata remotely

From the comfort of your own office



Ok, fellow MAs, it's second term, and quite a few of us are taking one, two, or even trois quantitative courses, and it's inevitable that you'll need Stata to get through the problem sets.

Now, you could just use the computer lab, but if you need to do work after hours or on the weekend, you're kinda screwed. Luckily for you, I'm making this guide!

Follow the instructions below, and you'll be well on your way to long, sleepless nights in your office. Enjoy!




  1. First, we're going to open up Konsole, the terminal program.
    Go to Applications > System Tools > Konsole.



  2. We want to take a file that is on our computer's desktop and copy it to the remote computer. Then we can use Stata.

    Type ls to see a list of files in your directory. Here we see the file we want to copy, grad_school_bribes.dta.

    The remote copy command is scp source username@server:~/destination. Here, the source is the file we want to copy, my username is leejf, the server is tobin.econ.queensu.ca, and the destination is a new file with the same name, in my home directory on Tobin. For a full list of availible servers, go here.

    You'll be prompted for your password, which is probably the default one from the beginning of the year. You should probably change it, using passwd, to something you can remember once you've logged in. It'll show you the copying progress, and then it'll finish.



  3. Now we want to actually log into Tobin. The command for this is ssh server -l username. Our server and username are the same as before. You'll be prompted for your password, and then you'll reach this screen. (If it asks you about RSA or authentication or something, just say yes.)



    We can type ls again to reassure ourselves that we actually copied the file over. There it is!

  4. Now we get to use Stata. There are two commands to choose from, stata or xstata.

    stata is faster, but it's command-line-only, so your variables aren't always displayed, and graphs always output to a file, not onscreen.

    xstata is likely easier to use, and you can see graphs, etc when you make them, but it'll run more slowly, since it's being run over the network. You can use either one.

    Here are screenshots of both modes. I've used ls again to show you what it'll look like inside Stata (it actually runs ls -la).

    xstata:



    stata:



  5. And that's it! Now you can get to Stata from anywhere. For most of the QED servers, this will even work from Res or from off-campus or from Tahiti. Enjoy!