Introduction to Linux Workshop 2. The George Washington University SEAS Computing Facility

Similar documents
Project #6: Using ssh, scp and sftp with Key-Based Authentication

FEPS. SSH Access with Two-Factor Authentication. RSA Key-pairs

Cryptography Application : SSH. Cyber Security & Network Security March, 2017 Dhaka, Bangladesh

Remote Access to Unix Machines

2-1-1 ssh Secure SHell

Bitnami Apache Solr for Huawei Enterprise Cloud

ssh and handson Matsuzaki maz Yoshinobu 1

Configuring SSH Public Key Authentication

Cryptography Application : SSH. 7 Sept 2017, Taichung, Taiwan

Setting up a Chaincoin Masternode

2-1-1 ssh Secure SHell

SSH. What is Safely 6/19/ June 2018 PacNOG 22, Honiara, Solomon Islands Supported by:

Telnet/SSH. Connecting to Hosts. Internet Technology 1

What is Secure. Authenticated I know who I am talking to. Our communication is Encrypted

TELE301 Lab16 - The Secure Shell

Unit: Making a move (using FTP)

Siemens PLM Software. HEEDS MDO Setting up a Windows-to- Linux Compute Resource.

Cryptography - SSH. Network Security Workshop May 2017 Phnom Penh, Cambodia

Bitnami MEAN for Huawei Enterprise Cloud

Cryptography - SSH. Network Security Workshop. 3-5 October 2017 Port Moresby, Papua New Guinea

Using a Linux System 6

sftp - secure file transfer program - how to transfer files to and from nrs-labs

Secure Shell Commands

Siemens PLM Software. HEEDS MDO Setting up a Windows-to- Windows Compute Resource.

Key File Generation. November 14, NATIONAL STUDENT CLEARINGHOUSE 2300 Dulles Station Blvd., Suite 220, Herndon, VA 20171

Secure Shell Commands

Linux Network Administration

User Guide Version 2.0

No More Passwords (with SSH)

New User Tutorial. OSU High Performance Computing Center

An Overview of SSH. Presentation to Linux Users of Victoria. Melbourne, August 26, 2017

Workshop on Genomics 2018

Adobe Marketing Cloud Using FTP and sftp with the Adobe Marketing Cloud

Fundamentals of Linux Platform Security

CS CS Tutorial 2 2 Winter 2018

IT Services Security. The Dark Arts Of SSH. Author: John Curran Version: 0.1

File transfer clients manual File Delivery Services

You can use the WinSCP program to load or copy (FTP) files from your computer onto the Codd server.

Practical Magic with SSH. By David F. Skoll Roaring Penguin Software Inc. 1 February

Using WestGrid from the desktop Oct on Access Grid

Bitnami JRuby for Huawei Enterprise Cloud

Introduction to Linux Workshop 1

Secure SHell Explained!

UoW HPC Quick Start. Information Technology Services University of Wollongong. ( Last updated on October 10, 2011)

First-Time Login Procedure on XWin32

Temple University Computer Science Programming Under the Linux Operating System January 2017

Security with SSH. Network Startup Resource Center

Setting up PuTTY. Software* Download PuTTY 6/9/18. Microsoft Windows 7 (64-bit) PuTTY 0.70 (64-bit) PuTTYgen 0.70 (64-bit) WinSCP 5.13.

WinSCP. Author A.Kishore/Sachin

Robert Bukowski Jaroslaw Pillardy 6/27/2011

Introduction to the Linux Command Line

Author A.Kishore/Sachin WinSCP

File Transfers. Contents

Session 1: Accessing MUGrid and Command Line Basics

APSCN VPN Settings for Windows 7 2. APSCN VPN Settings for Windows XP 8. APSCN VPN Settings for MAC OS 15

LAB #5 Intro to Linux and Python on ENGR

Bitnami MySQL for Huawei Enterprise Cloud

LAB :: Secure SHell (SSL)

Bitnami MariaDB for Huawei Enterprise Cloud

Linux for Biologists Part 2

Secure Shell Commands

Ftp Command Line Manual Windows Example Port 22

Parallel Programming Pre-Assignment. Setting up the Software Environment

Galaxy How To Remote Desktop Connection and SSH

ECE112 - Lab 6. Purpose. Parts/tools needed: Make sure we have a properly working environment

Helsinki 19 Jan Practical course in genome bioinformatics DAY 0

Lab 1: Accessing the Linux Operating System Spring 2009

Introduction: What is Unix?

For Dr Landau s PHYS8602 course

Additional laboratory

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG

CS 261 Recitation 1 Compiling C on UNIX

Contents. Configuring SSH 1

NoMachine NX Client Configuration Guide

Operating Systems. Copyleft 2005, Binnur Kurt

Setting up PuTTY. CTEC1767 Data Communications & Networking CTEC1863 Operating Systems CTEC1906 Internet Computing

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing

Introduction to CARC. To provide high performance computing to academic researchers.

LECTURE 7. Readings: - SSH: The Definitive Guide; D.J. Barret et al.; O Reilly Lecture outline: - SSH. Marco Spaziani Brunella, Manuel Campo

HPC Account and Software Setup

Bitnami Coppermine for Huawei Enterprise Cloud

Bitnami HHVM for Huawei Enterprise Cloud

Tutorial: SSH. Secure SHell: Connect remotely anything, anywhere. UL High Performance Computing (HPC) Team Sebastien Varrette

Ftp Command Line Commands Linux Example Windows Putty

Contents. SSL-Based Services: HTTPS and FTPS 2. Generating A Certificate 2. Creating A Self-Signed Certificate 3. Obtaining A Signed Certificate 4

HOBLink Terminal Edition Quick guide

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

Spring 2017 Gabriel Kuri

Backup and Restore Technical Note

Lab #9: Basic Linux Networking

Most of the programming assignments in CS 2505 will require using the C language. We will use a (relatively) current version of the GCC C compiler.

Setup Guide. Page 0

How to Enable SFTP on MPE

INSTALLING AN SSH / X-WINDOW ENVIRONMENT ON A WINDOWS PC. Nicholas Fitzkee Mississippi State University Updated May 19, 2017

Tectia Client/Server 6.3 (Windows) Quick Start Guide

Introduction to Linux for BlueBEAR. January

Bitnami ProcessMaker Community Edition for Huawei Enterprise Cloud

Bitnami ez Publish for Huawei Enterprise Cloud

bs^ir^qfkd=obcib`qflk= prfqb=clo=u

Ftp Command Line Manual Windows Username Password Linux

Transcription:

Introduction to Linux Workshop 2 The George Washington University SEAS Computing Facility

Course Goals SSH and communicating with other machines Public/Private key generation,.ssh directory, and the config file SFTP, SCP, and file transfer Porting X11 session to your local machine Modules

SSH - What is it? SSH, also known as Secure Socket Shell, is a network protocol that provides administrators with a secure way to access a remote computer. Allows users to securely log into another computer over an insecure network, executes commands and transfers files Created as a replacement for telnet, ftp, rlogin, rsh, and rcp SSH traffic is always encrypted, which makes it safer Usually communicates on port 22, but it can use any port you specify

SSH SSH Components SSH Always has a Client and a Host Client - the machine you are sitting in front of A client needs a program, called an SSH client, to connect to another machine via SSH. Host - the server you want to connect to A host is any machine listening for SSH connections. It runs a program called SSHD that waits for SSH connections. When your client sends a request to connect, SSHD handles the negotiation that lets you log in.

SSH - Authentication SSH has two common methods of authentication: Password authentication Not as secure as key authentication Easier to set up Key authentication Vastly more secure than password authentication Difficult to set up Easier to use once set up

SSH - Key Pair Definition SSH keys are a matching set of cryptographic keys which can be used for authentication. Each set contains a public and a private key. The public key can be shared freely without concern. The private key must be vigilantly guarded and never exposed to anyone. The private key is effectively your password A little later on we will generate a key pair and use it to login to a server

SSH - Features SSH is available on most platforms Clients are available for many platforms: Windows, Mac, Unix, Linux, iphone, Android, etc. Free for noncommercial use SSH can multiplex services over the same connection That means you can open an SSH connection and send other kinds of traffic through it One of the most powerful functions of multiplexing is port forwarding or tunneling SSH can securely tunnel insecure applications like POP3, SMTP, IMAP, and CVS.

SSH - Connect to a remote host We are going to use shell01.seas.gwu.edu for our remote host in this class To connect: ssh username@shell01.seas.gwu.edu enter your account password To disconnect: type "exit" at the prompt You can daisy chain connections from one host to another ssh username@shell.seas.gwu.edu (from shell01)

SSH - Useful commands when connected You can sometimes forget which machine you are connected to. Tips to find out where you are: look at the prompt type hostname type uname -a

SSH - Remote Terminal Exercise A big advantage of SSH is the ability to remotely control a machine without having physical access to it. Exercise: Make sure you are disconnected from shell01.seas.gwu.edu From your terminal, type /bin/uname -a What server name pops up? Type ssh username@shell01.seas.gwu.edu /bin/uname -a Enter your password and answer yes to any questions What server name pops up?

SSH - The.ssh Directory Inside your home folder, you can create a special folder named.ssh to hold your SSH configuration files and key pairs. Create your own.ssh directory: 1. cd ~ 2. mkdir.ssh 3. chmod u+rwx,g-rwx,o-rwx.ssh You change permissions on the.ssh directory because it can hold your private key, which is just like a password!

SSH -.ssh Directory Files Most.ssh directories have configuration files in them. These are some common ones: config - holds configuration information for connecting to specific hosts. authorized_keys - holds public keys for accounts that are allowed to authenticate. If a public key and a private key match, then that account can authenticate known_hosts - a file that holds keys of servers you have connected to. If a server's key has changed, you will be warned when you connect. id_rsa.pub - a public key file id_rsa - a private key file

SSH - Generate a key pair Let's generate your key pair! 1. Make sure you are logged out from shell01 (check your prompt) 2. cd ~/.ssh 3. ssh-keygen -t rsa -b 4096 -C "username@gwu.edu" a. rsa is the algorithm for encryption b. -b is the number of bits for your key c. 4096 bits is 512 bytes, or the equivalent of a 512 character password!

SSH - Lets look at your keys Your keys will appear to be gibberish, but they are magic! cd ~/.ssh cat id_rsa - this is your private key cat id_rsa.pub - this is your public key

SSH - Create your authorized_keys file If a public key is added to the authorized_keys file, then a user with the corresponding private key can login to that account cd ~/.ssh touch authorized_keys cat id_rsa.pub >> authorized_keys chmod u+rw,g-rwx,o-rwx authorized_keys

SSH - Create your config file You can force key authentication for a server by creating a config file cd ~/.ssh nano config, then type: Host shell01 Hostname shell01.seas.gwu.edu PreferredAuthentications publickey User <username> Save the file

SSH - Login to Shell01 with your key If configured correctly, you can now SSH to shell01 without having to enter a password. ssh shell01 This is the shortcut you created in your config file

SSH - SFTP The SSH File Transfer Protocol (SFTP) enables secure file transfer capabilities between networked hosts. All SFTP traffic is encrypted FTP (File Transfer Protocol) is insecure. SFTP, like SSH, requires a client and a host (server). You authenticate with the same credentials you use for SSH

SSH - SFTP command line client SFTP can be used at the command line on linux machines and some Apple machines. You can launch it by typing: sftp username@shell01.seas.gwu.edu Use? for help Regular commands occur on the remote server. ls, pwd, cd, etc. To work on your local machine, prepend the letter l to the commands: lpwd, lls, lcd, etc. Use "put" to transfer files TO the server Use "get" to transfer files FROM the server

SSH - SFTP GUI Clients Using the command line SFTP client is confusing, frustrating, and inconvenient. There are many free SFTP utilities for Windows, Apple, and Linux machines. GUI clients are easy to use and necessary if you will transfer a large amount of folders or files between machines. Windows Filezilla - https://filezilla-project.org Apple Cyberduck - https://cyberduck.io Linux Filezilla - https://filezilla-project.org

SSH - Secure Copy (SCP) The scp command securely copies files and directories between remote hosts without starting an FTP session or logging into the remote systems explicitly. The scp command uses SSH to transfer data, so it requires a password or passphrase for authentication. Usage: scp Source Destination scp user@host1:file1 user@host2:file2 host1 or host2 can be your local workstation or the server You do not need to include the user@host* section when referring to your local workstation. Just the path is OK

SSH - SCP Examples SCP is good for moving one or two files quickly. Move a file FROM a server TO your workstation: scp username@shell01:/tmp/class_example.txt /homedirectory/ Move a file TO a server FROM your workstation: scp /homedirectory/class_example.txt username@shell01.seas.gwu.edu:/tmp/username.txt In the second example, we are renaming the file so the whole class doesn't try to write the same file name at the same time.

SSH - SCP Examples SCP is good for moving one or two files quickly. Move a file FROM a server TO your workstation: scp username@shell01:/tmp/class_example.txt ~/ Move a file TO a server FROM your workstation: scp ~/class_example.txt username@shell01.seas.gwu.edu:/tmp/username.txt In the second example, we are renaming the file so the whole class doesn't try to write the same file name at the same time.

SSH - X Windows X or XWindows was designed from the beginning to be network-centric, and adopts a "client-server" model. It provides a Graphical User Interface for Linux applications. An X "client" is usually an application written with X libraries, like Matlab or your Window Manager that makes up your desktop The X Server draws what you see on the screen and manages the keyboard and mouse. When you run an application remotely, your workstation is running the X Server.

SSH - X Windows X or XWindows was designed from the beginning to be network-centric, and adopts a "client-server" model. It provides a Graphical User Interface for Linux applications. An X "client" is usually an application written with X libraries, like Matlab or your Window Manager that makes up your desktop The X Server draws what you see on the screen and manages the keyboard and mouse. When you run an application remotely, your workstation is running the X Server.

SSH - X Windows Architecture

SSH - X Windows Forwarding Requirements X Window Forwarding refers to sending the display of a program from one machine to another. Forwarding requires a small program to run on machines without a native X Server if you want to port the display to your workstation. Windows and OS X do not have a native X Server built in Most linux builds have an X Server built in

SSH - X Windows Server programs Windows X Ming (use with Putty) - https://sourceforge.net/projects/xming/ MobaxTerm (Easier) - http://mobaxterm.mobatek.net/ Apple OS X XQuartz - https://www.xquartz.org/ XQaurtz may require you to install the Apple OS X SDK from the Apple Store (free download) Linux An X Server is usually installed with the OS

SSH - X Window Forwarding Connection You need to tell your SSH session that you want to forward X traffic from the machine you are connecting to. Windows Your SSH client will have a checkbox somewhere that says "Forward X traffic" In Putty it is under the Connection/SSH/X11 menu If you use Putty, you have to launch XMing manually Apple OS X ssh -X username@server (this will automatically launch XQuartz) Linux ssh -X username@server

SSH - X Window Forwarding Exercise Use your linux workstation to start an X connection to shell01 From the terminal: 1. ssh -X username@shell01.seas.gwu.edu 2. type xeyes 3. Close xeyes 4. type xclock 5. close xclock 6. type xterm 7. In the xterm window, type hostname 8. close xterm

Modules Modules are small scripts that run and configure your linux environment so it can run a specific program. Modules load an environment so a program can run correctly. SEAS uses modules on Shell01 for Matlab, anysys, Comsol, and other programs. Modules do not install a program, they only configure your environment. Modules can be loaded simultaneously with other modules. Modules can be requested for shell01 via support@ticket.seas.gwu.edu Modules can be requested for Colonial One via hpchelp@gwu.edu

Modules - Module commands module avail - show available modules module list - show loaded modules module load - load a module module unload - unload a module

Modules - Module syntax Use module avail to see a list of modules you can load. Use the full name of the module to prevent confusion since there may be more than one version of a program available. module avail results: abaqus/abaqus_v6.13-3 comsol/comsol_5.1_fnl matlab/r2015b pgi/10.5 anaconda/anaconda3 comsol/comsol_5.2_ckl mpi/compat-openmpi-psm-x86_64 silvaco/tcad2015 ansys/ansys16.2 comsol/comsol_5.2_fnl mpi/compat-openmpi-x86_64 tecplot/tecplot360ex_2014

Modules - Module Exercise Use module load to load files. Remember to use the full name of the module! ssh -X username@shell01.seas.gwu.edu Before you load the module: type runwb2. What happens? type module load ansys/ansys16.2 Now type runwb2 again. What happens? Choose File Exit and close Ansys workbench type printenv then find the entry in your PATH variable that lets you load Ansys type module unload ansys/ansys16.2 Type printenv again and see if the ansys entry is in your PATH variable