PHS-Linux Server

This is a guide to how to access the Linux server. The Linux environment is dedicated to our AMC data. If you have been granted access to any of our other datasets, we kindly ask you to follow the instructions on how to access the Windows server that can be found here

 

1. Introduction
2. How to use the PHS-Linux Server

  • Two-Factor Authentication: Duo Mobile
  • Smartphone/Mobile phone registration

3. PHS-Linux Server Access for Windows Machines

  • Installation of the Stanford VPN (Virtual Private Network)
  • Connect and Disconnect to Stanford VPN
  • Using Microsoft Remote Desktop 

4. PHS-Linux Server Access for Mac Machines

  • Installation of the Stanford VPN (Virtual Private Network)
  • Installation of Microsoft Remote Desktop
  • Using Microsoft Remote Desktop or
  • using the command line: SSH Instructions for connecting to PHS-Linux

5. Closing session

  • Logging out
  • How to get help
  • A few notes on using SAS

 

1. Introduction

 

What is the PHS-Linux Server?

The PHS-Linux server is a powerful computer where programs like SAS, Stata, R, Matlab, and other analysis tools is available to all users remotely. After connecting to the server, users have access to licensed software tools and shared published data from other collaborators. It serves as a central repository for all AMC and other research data, and it allows for more efficient data management as well as increased data security.

Why?

Migration to the PHS-Linux server will allow all researchers to take advantage of significant computing capabilities currently unavailable on most personal computers. It will also improve the security of the AMC and other protected health information datasets which is becoming more important to funders and those who provide us with external data to append to our cohorts. All researchers are required to acknowledge in writing that all appropriate data files have been moved to the server and removed from all local computers.

 

2. How to use the PHS-Linux Server

 

Access the PHS-Linux server from your Windows or Mac computer by using these tools:

  1. Two-factor authentication program called Duo Mobile
  2. A secure network connection (VPN) software package called Cisco AnyConnect
  3. A remote desktop package called Microsoft Remote Desktop OR by using the command line

Login to the server with a Stanford user ID (called a SUNet ID) and run your analysis software (e.g., SAS, Stata, R) there instead of running on your local laptop or desktop. You will still see windows for your analysis software – but it will actually be running on the PHS-Linux server at Stanford.

Basic Workflow:

Depending on your computer, you may need your IT department to install these programs or required updates if you do not have administrative rights. You need to configure Duo Mobile authentication, preferably using their auto-push mode, and install the Stanford VPN and Microsoft Remote Desktop software to connect to the system. 

 

Two-Factor Authentication: Configuring Duo-Autopush

Authentication in this case simply means proving who you are to a computer system.  Most people are familiar with using a password, a “first factor” if you will.  It is becoming common (and wise) to use a second way of proving who you are and Stanford uses Duo for this two-factor authentication.  In order to logon to the PHS-Linux system, you must first configure autopush.  Autopush automatically pushes a Duo prompt to your default device.

Stanford uses Duo for two factor authentication.  In order to logon to the PHS-Win system, you must first configure autopush. Autopush automatically pushes a Duo prompt to your default device. We strongly recommend your default device to be a smartphone. If that is not possible, use a tablet. Barring those options, the best option will be a phone near your work area. To configure:

1. Open a browser on your computer and visit the Stanford Accounts Application     ( https://accounts.stanford.edu ).

 

2. Click Manage.

3. Click the Two-Step Auth tab.

 

4. If this is the first time you are setting up your two-step authentication, click Enable.  (Enable is not shown in the example.)  Or if you already have a device set up, a page showing your two-step authentication devices displays. Click Add a device.

5. On the Set up a new device page, make a device selection.

 

6. Enter your phone number, assign a name to this device, and click continue. If this is not your first device, you will be given the option to change your default device. If you are not using a smartphone with Duo, click Done and you are ready to test.  Note: If your phone has an international number, click the international number? link to see whether two-step authentication supports phone calls and SMS text messages to that country.

 

 

7. Next, you are presented with the opportunity to get the Duo Mobile app.

8. Recommended: Click Yes, I want to use Duo Mobile so you can activate push notifications and passcodes.

9. If you want to use only SMS text messages or phone calls for authentication, click No, maybe later. (You can install and activate Duo Mobile later.)

 

 

10. If you choose to install Duo Mobile now, go to the app store on your device and search for Duo Mobile. (Clicking the icon for your platform takes you there.) After you have installed it, click I have the app.

 

 

11. Activate Duo mobile on your smartphone by choosing one of three options:

a. Open the Duo Mobile app on your smartphone and tap the “+” in the upper right corner. Then,  point your camera at the QR code displayed and tap Scan Barcode.

b. Visit the URL at the bottom of the page with your smartphone. The URL opens inside the Duo Mobile app.

c. Click Send the activation URL above to your smartphone as an SMS  text message and then tap the link in the message or copy it to your browser.

 

PLEASE NOTE: Do NOT use the following sample barcode to set up your phone.  It will not work. You will get a unique barcode when you set up your Smartphone starting from the Accounts app.

 

 

12. Click continue when your account has been added to Duo Mobile.  If you  want to make your smartphone your default device, click Yes, make <my device> my default. If you do not want your smartphone to be your default device, click No, I’ll keep <my current default device> as my default.

 

 

13. If you made your smartphone your default device, you need to choose a default method. All methods are available but the login page presents your default method first.

PLEASE NOTE: If you did not install and activate Duo Mobile, the only methods available is phone call.

 

 

14. A message saying that you have successfully set up your device displays. Click Done to exit.

 

 

Authenticate

 

Since March 30 2018, the two-step authentication login has been updated. For more information, click here.

  • Duo app – push notification (recommended) — a push notification is sent to the device, and you can review the request and tap Approve to authenticate. Internet or cellular access is required to use this method.
  • Phone call — you receive an automated phone call  that requires you to press any key to authenticate.

 

Visit the University IT site for the latest information around setting up your smartphone.

 

back to top

 

3. PHS-LINUX SERVER ACCESS FOR WINDOWS MACHINES:

Install the VPN client

 

1. Go to su-vpn.stanford.edu to download the Cisco AnyConnect VPN client.

2. When the login screen is displayed, select the Group:

  1. Default Stanford split-tunnel: access to anything at stanford.edu is via the VPN connection but non-Stanford traffic flows normally on an unencrypted internet connection.
  2. Full traffic non-split-tunnel: all internet traffic flows through the VPN connection.

3. Enter your SUNet ID and Password and then click Login. (You can ignore the Group field here; this is set when you connect to the VPN.)

 

 

4. Click Continue to connect to the Stanford Public VPN service. 

 

 

5. The Cisco AnyConnect VPN client requires a Java or Active X plug-in, depending on your browser,  to  install automatically. If the web-based installation is unsuccessful, click the link provided in the window.

 

6. If you are doing a manual installation, download and run the installer file. 

 

 

7. When the Setup Wizard starts, click Next to continue.

 

 

8. Accept the terms in the license agreement and click Next. 

 

 

9. Click Install to start the installation. 

 

 

10. Click Finish to complete the installation and exit the Setup Wizard. 

 

 

Connect to the Stanford VPN

 

1. Launch the VPN client:

  1. Windows 7: Click the Start button. If you don’t see Cisco AnyConnect Secure Mobility Client in the list of programs,  navigate to All Programs >Cisco > Cisco AnyConnect Secure Mobility Client. Click Cisco AnyConnect Secure Mobility Client.
  2. Windows 8.1/10:  On the Start screen, click the down arrow in the bottom-left corner of  the screen to access your installed apps. Double-click Cisco AnyConnect Secure Mobility Client.

2. When prompted for a VPN, enter su-vpn.stanford.edu and then click Connect. 

 

 

4. Enter the following information and then click OK:

  • Group: select Default Stanford split- tunnel (non-Stanford traffic flows normally on an unencrypted internet connection) or Full Traffic non-split-tunnel (all internet traffic flows through the VPN connection)
  • Username: your SUNet ID
  • Password: your SUNet ID password

 

5. Next, the prompt for two-step authentication displays. 

 

  • Enter a passcode or enter the number that corresponds to another option (in this example, enter 1 to authenticate using Duo Push).  You may have to scroll down the list to see all of your options. Then click Continue.
  • We recommend that you do not select phone call to your smartphone for your second factor. This method has not been consistently reliable during testing. You can, however, use a landline such as your office phone for authentication.
  • If your only registered authentication method is printed list, hardware token, or Google Authenticator, the menu does not display. Enter a passcode in the Answer field and click Continue.
  • You may see a truncated menu if you  have multiple two-step devices enabled. Enter a passcode or choose a second factor from the options provided (in this example, enter push1 to authenticate using Duo Push).  Then click Continue.

PLEASE NOTE: It may take a bit of trial and error to associate secondary factors with devices. 

 

 

6. Click Accept to connect to the Stanford Public VPN service. 

 

 

7. Once the VPN connection is established, the Cisco Anyconnect icon with a small lock appears in the notification area in the lower-right corner of your screen. (You many need to click the arrow to show hidden icons to see it.)

 

Disconnect from the Stanford VPN

 

  1. In the notification area, click the Cisco AnyConnect icon with a small lock.
  2. At the prompt, click Disconnect.

 

 

Microsoft Remote Connection for Windows – installing and using

 

Your Windows system comes with Microsoft Remote Desktop Connection a tool that lets you open a windows on your computer that is actually running on the remote PHS-Linux server.

1. To launch Remote Desktop open the start menu and in the search bar type ‘remote desktop’ and you should see the ‘Remote Desktop Connection’ program at the top of the list.

 

2. Click on ‘Remote Desktop Connection’ to launch the program.

 

 

3. Enter ‘phs-linux.stanford.edu’ into the ‘Computer’ field, and click the Connect button.

 

 

 

4. Enter ‘SUNetID’ for the ‘User Name’ and your SUNetID password then click ‘OK’ or press enter.

 

 

 

5. Click ‘OK’ to send login information to session manager.

 

 

6. Next your phone will prompt you to accept a Two Factor Authentication request. Not: this will NOT appear on the screen, but you should make sure you keep your phone close by to accept any incoming prompts.

 

 

7. Within a few seconds of accepting the Two Factor Authentication prompt on your default device, you will be connected to the phs-linux server.

 

 

8. Based on your data request application, you will have access to the specific datasets located on the linux server.

 

 

9. Launch your favorite program by clicking on “Applications” on the upper left corner of the screen.

 

 

PLEASE NOTE: if using Stata and R on the Linux Server. When opening a Stata or R file saved on the Linux server, do so from an open R or Stata session. Clicking directly on an R or Stata file will not open; you must call the file from the session itself, as seen below:

 

 

Logging Out

 

When logging out and terminating your session, it is important to save your work, close all of your programs, and log off so that no old sessions get leftover on the server.

1. Click on your SUNet id on the upper right corner of the screen and select “quit”

 

2. The system will ask for confirmation and will logout and close the window counting down within 60 seconds if you don’t respond.  You have the option to change your mind and cancel the logout.

 

 

 

back to top

 

4. PHS-Linux Server Access for Mac Machines

 

Install the VPN client

 

1. Go to su-vpn.stanford.edu to download the Cisco AnyConnect VPN client. Make sure to choose Cisco AnyConnect for Mac. Follow the instructions. 

2. When the login screen is displayed, select the Group:

  • Default Stanford split-tunnel: access to anything at stanford.edu is via the VPN connection but non-Stanford traffic flows normally on an unencrypted internet connection.
  • Full traffic non-split-tunnel: all internet traffic flows through the VPN connection.
  • Enter your SUNet ID and Password and then click Login. (You can ignore the Group field here; this is set when you connect to the VPN.)

 

 

 

 

 

Connect to the Stanford VPN

 

1. Launch the VPN client: 

  • Windows 7: Click the Start button. If you don’t see Cisco AnyConnect Secure Mobility Client in the list of programs,  navigate to All Programs >Cisco > Cisco AnyConnect Secure Mobility Client. Click Cisco AnyConnect Secure Mobility Client.
  • Windows 8.1:  On the Start screen, click the down arrow in the bottom-left corner of  the screen to access your installed apps. Double-click Cisco AnyConnect Secure Mobility Client.

2. When prompted for a VPN, enter su-vpn.stanford.edu and then click Connect. 

 

 

3. Enter the following information and then click OK:

  • Group: select Default Stanford split-tunnel (non-Stanford traffic flows normally on an unencrypted internet connection) or Full Traffic non-split-tunnel (all internet traffic flows through the VPN connection)
  • Username: your SUNet ID
  • Password: your SUNet ID password

 

 

4. Next, the prompt for two-step authentication displays.

  •  Enter a passcode or enter the number that corresponds to another option (in this example, enter 1 to authenticate using Duo Push).  You may have to scroll down the list to see all of your options. Then click Continue.
  • We recommend that you do not select phone call to your smartphone for your second factor. This method has not been consistently reliable during testing. You can, however, use a landline such as your office phone for authentication.

 

 

  • If your only registered authentication method is printed list, hardware token, or Google Authenticator, the menu does not display. Enter a passcode in the Answer field and click Continue.
  • You may see a truncated menu if you  have multiple two-step devices enabled. Enter a passcode or choose a second factor from the options provided (in this example, enter push1 to authenticate using Duo Push).  Then click Continue.
  • Note: It may take a bit of trial and error to associate secondary factors with devices.

 

5. Click Accept to connect to the Stanford Public VPN service.

 

 

 

 

 

 

6. Once the VPN connection is established, the Cisco Anyconnect icon with a small lock appears in the notification area in the lower-right corner of your screen. (You many need to click the arrow to show hidden icons to see it.)

 

Disconnect from the Stanford VPN

 

1. In the notification area, click the Cisco AnyConnect icon with a small lock.

2. At the prompt, click Disconnect. 

 

 

 

 

Install Microsoft Remote Desktop for Mac

 

1. Open the App store on your Mac. Make sure to switch to the US Apple Store

2. Search for the ‘Microsoft Remote Desktop 10’ program and click install.

3. Following on-screen prompts, log in to your Apple ID for the App store if necessary, and open the program once the install is complete.

4. Open Microsoft Remote Desktop Connection.

5. Select “New” and input the following information: 

 

 

PLEASE NOTE:  xRDP starts up a new session if you connect at  a different screen resolution.  To stay in the same session we suggest you set the connection resolution in the connection dialog box:

 

 

 

6. Enter your SUNetID for the ‘User name’ and your SUNetID Password for the ‘Password’, then click ‘OK’ or press enter.  Close the window.

7. Highlight phs-linux and select “Start” from the top of the menu.  The first time you may see this screen: 

 

 

8. Choose Connect Always.

9. Select OK and you will receive an auto-authentication from Duo after about 15 seconds.  Please Accept and Confirm and you are now ready to use the PHS-Linux server. 

 

 

10. Based on your data request application, you will have access to specific datasets. 

 

 

11. Launch your favorite program, and enjoy!

 

Notes on using Stata and R on the Linux Server: When opening a Stata or R file saved on the Linux server, do so from an open R or Stata session. Clicking directly on an R or Stata file will not open; you must call the file from the session itself, as seen below:

 

 

 

SSH Instructions for connecting to PHS-Linux

  1. Connect to Stanford VPN
  2. Open Terminal
  3. Type “sshsunetID@phs-linux.stanford.edu“, where “sunetID” = your Stanford SUNetID and hit Enter.
  4. If prompted to confirm the ssh host, type “yes”
  5. When prompted for password, enter your Stanford password.
  6. You should receive a Duo two-step authentication notification. Approve.
  7. Your ssh session should be connected following the Duo prompt.

 

To connect to RStudio on PHS-Linux, from a Mac/Linux machine:

  1. Connect to Stanford VPN
  2. Open Terminal
  3. Type “ssh -L8787:localhost:8787 sunetID@phs-linux.stanford.edu”, where “sunetID” = your Stanford SUNetID and hit Enter
  4. If prompted to confirm the ssh host, type “yes”
  5. When prompted for password, enter your Stanford password.
  6. You should receive a Duo two-step authentication notification. Approve.
  7. For GUI, type on browser: http://localhost:8787
  8. Enter sunet and password (if asked)
  9. You should receive a Duo two-step authentication notification. Approve.
  10. You should now be connected to RStudio on PHS-Linux

 

5. Closing session

Logging Out

 

When logging out and terminating your session, it is important to save your work, close all of your programs, and log off so that no old sessions get leftover on the server.

  1. Click your SUNetID in the top right corner of the desktop.
  2. Select “Quit” from the dropdown menu.

 

The system will ask for confirmation and will logout and close the window counting down within 60 seconds if you don’t respond.  You have the option to change your mind and cancel the logout.

 

 

A few notes on using SAS

 

We use the Linux version of SAS on the server, and it may look a bit different from what you’re used to.

  1. The enhanced editor is not available.
  2. You can only have 1 program editor open at a time; however, you can have as many “Gedit” (a text editing program) files open as you want, so you can refer to other SAS programs while in SAS. When double clicking on a SAS program, the default program opening it is Gedit. To open directly into SAS, right click on the file, select “Open with” and choose SAS.
  3. Keyboard shortcuts for cut, copy, and paste are not available. You’ll need to use the drop down menus to access those features.
  4. SAS windows are “in pieces” – i.e., the log, editor, results, and toolbox are all “freestanding” windows.
  5. If you don’t like how something looks (e.g., line numbers), you can customize things using the Options tab under Tools.

While these things take a little while to get used to, the functionality should be the same as the Windows version of SAS that many currently use.

 

 How to get help

 

  • For technical assistance, send email to PHS-computing@stanford.edu.  Please include as much information as possible (you desktop or laptop operating system, your version of Microsoft Remote Desktop software, a screenshot showing the problem you have encountered, etc.)
  • For questions about the data that’s available on the server or anything else related to PHS policies, email phsdatacore@stanford.edu
  • SIGN UP HERE for PHS Data Core Office Hours

 

PHS Data Core Office Hours: Please check our website for the most up to date schedule and to ensure there are no cancellations.

 

back to top