galaxy how to SSH-VNC

advertisement
Galaxy How To – SSH, VNC and Port Forwarding/Tunneling Through SSH The host name for the Econ Linux server is galaxy.econ.jhu.edu. It is running Ubuntu 12.04 LTS. Please NOTE: you need to be connected to the Hopkins VPN before attempting a connection if you are off campus. Please refer to the Ubuntu 12.04 LTS documentation for additional help: https://help.ubuntu.com/12.04/ubuntu‐
help/index.html To connect to it you can use ssh, or ssh and a vnc viewer for a graphic display. 1. SSH only: Any SSH client will work. Putty (SSH): To connect from a Windows machine, download putty from http://www.putty.org/ and install. Any other SSH application should work as well. Open putty and type in the Host Name or IP address for the Ubuntu machine ‐(galaxy.econ.jhu.edu). You can name and save your session. Type your user name and password and login. To exit type “exit” at the prompt $. For Macs ‐ in a terminal session enter: $ ssh user‐name@galaxy.econ.jhu.edu To keep processes running after ending the ssh session: 


ssh into your remote box. Type screen, then start the process you want. Press Ctrl‐A then Ctrl‐D. This will "detach" your screen session but leave your processes running. You can now log out of the remote box. If you want to come back later, log on again and type "screen ‐r". This will "resume" your screen session, and you can see the output of your process. To stop a process  kill processID  Will attempt to kill the indicated process 'gently", giving it a chance to save and close files and perform other housekeeping. If a subsequent check, after a few seconds, with the ps command shows that the errant process is still running, you can give the much more definitive "hard" kill:  kill ‐9 processID 2. VNC connection: Along with your linux username and password you will be assigned a display number for the VNC connection as well as a VNC password. Initially both passwords will be the same. Changing one of them does not change the other. You should change both after your first login. Note: VNC passwords are limited to 8 characters. The easiest way to do this is trough SSH. 
To change your Linux password log on to Galaxy and at the prompt type: $ passwd When prompted enter your current password and then the new one. 
To change your VNC password log on to Galaxy and at the prompt type: $vncpasswd When prompted enter your new password. Download and install TurboVNC. [http://www.virtualgl.org/Downloads/TurboVNC]. Any other VNC viewer should work too. For Macs: try Chicken of the VNC [http://sourceforge.net/projects/cotvnc/] Launch the VNC viewer and append the desktop number to the host name ‐ galaxy.econ.jhu.edu:4, and connect. You will be prompted only for your password: Once connected you will see the Ubuntu Unity GUI where you can start any of the installed applications. To disconnect just close your VNC window (x). Do not log off. 3. Connecting and mounting network shares: Open your Home folder and go to File and then Connect to Server. Enter the appropriate server name, type, share and log on information. Screenshot: If you need the path to your files the mount point for network shares is the local .gvfs folder. To see it in your home folder, open the home folder and go to edit and then preferences. Choose "show hidden and backup files". To unmount a share right click on it and choose “unmount” or click on “eject” . To locate the directory in Terminal type: $cd /home/user_name/.gvfs/"users2 on stella.win.ad.jhu.edu/temp" You can mount network shares manually using the terminal as well: Note: You must be logged on through RDC or VNC before doing that. $ gvfs‐mount smb://stella.win.ad.jhu.edu/users2/temp To unmount use: $ gvfs‐mount – u smb://stella.win.ad.jhu.edu/users2/temp Refer to the figure below: 4. Transferring files using WinSCP [use SFTP] For Macs: Cyberduck [http://cyberduck.ch/] http://download.cnet.com/WinSCP/3000‐2160_4‐10400769.html 5. Launching applications: All applications are accessible through Dash Home (click on the Ubuntu logo on the top left). To find an application start typing in the search box, to see a list of available applications click on the “Applications” icon. 1. Stata MP4 Stata can also be launched from the terminal using the command “stata‐mp” or “xstata‐mp” for the graphical interface. 2. Matlab Matlab can be launched from the terminal using the command “matlab”. 3. Mathematica – use the command “mathematica” at the terminal. 4. R – use the command “R” at the terminal or “rstudio” for a GUI. 6. Monitoring CPU Load Please be mindful of the resources you are taking while using Galaxy, especially when running Matlab. Depending on the computation you are running, the load gets distributed among all available CPUs. Running 1 Matlab process doesn't necessarily mean using 1 CPU, or using 4 workers ‐ 4 CPUs. For the time being, since there are no restrictions or quotas in place, please keep an eye on the average load (run "top" ‐ press 1 to see per CPU load) each time there is a need of using more than 4‐6 cores. If you notice congestion or higher than average load, please reduce the number of cores used and/or communicate to the rest of the Galaxy users that have jobs running including me as well. Also to reduce I/O overhead, which adds to the average load, consider copying and running all scripts from within your home directory on Galaxy and not over the network. You can make backup copies of all results to your network shares as often as you like. 7. VNC encrypted through the SSH tunnel: By default VNC is not a secure protocol. VNC uses encryption during the initial connection and login (passwords are not sent in plain text). Once you are connected, all the VNC data is unencrypted. It is safer to start VNC through an SSH tunnel. 1. If you installed the PuTTY SSH client, then run it, enter the IP address or hostname of the server to connect to, click on "SSH" (not Telnet or the others), and then go down to the "Tunnels" section. Enter 590n as the source port and localhost:590n as the destination, and click the "Local" option (not Remote). Note: n is your assigned VNC display number. The screenshots are using display number 2. Then click on the Add button. Go back to the “session” section and save the changes. Finally, click on Open to start the SSH connection. Enter your SSH username and password to log in. 2. Once logged in through SSH, you can minimize that window. Then run the VNC client program, and tell it to connect to localhost: n. Enter the VNC password, and the remote desktop should show up. If you are using the OpenSSH client, then you can log in trough SSH by typing: $ ssh ‐l <ssh‐username> ‐L590n:localhost:590n <server IP or hostname> (Enter). Enter your SSH password when prompted. 
Download