Unit: Making a move (using FTP)

Similar documents
Lab 1 Introduction to UNIX and C

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

Using WestGrid from the desktop Oct on Access Grid

CS Fundamentals of Programming II Fall Very Basic UNIX

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program

Read the relevant material in Sobell! If you want to follow along with the examples that follow, and you do, open a Linux terminal.

What is EV3DEV? Send commands to the EV3 Upload programs and run them on the EV3

KEIL software. Index of contents UPDATE. 1. Important information 1.1. What has changed?

OPIA-ECCU INSTRUCTION STEPS FOR SUBMITTING AND RETRIEVING CARI REPORTS. Once the screen below has loaded, enter your Username, Password and the

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

KB How to upload large files to a JTAC Case

Introduction to the Linux Command Line

CSE 390a Lecture 3. Multi-user systems; remote login; editors; users/groups; permissions

CS CS Tutorial 2 2 Winter 2018

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

Introduction to Lab Practicals (Lab Intro 3) Access Control, Synchronisation and Remote Access

Exercise Sheet 2. (Classifications of Operating Systems)

Bitnami Apache Solr for Huawei Enterprise Cloud

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

Handling Ordinary Files

Setting up my Dev Environment ECS 030

Introduction to Lab Practicals (Lab Intro 3) Access Control, Synchronisation and Remote Access

Introduction to Linux Workshop 1

Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen

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

Bitnami MEAN for Huawei Enterprise Cloud

Unix. Examples: OS X and Ubuntu

Computer Systems and Architecture

Introduction: What is Unix?

Traditional Access Permissions

Bitnami JRuby for Huawei Enterprise Cloud

Unix Essentials. BaRC Hot Topics Bioinformatics and Research Computing Whitehead Institute October 12 th

Getting started with Raspberry Pi (and WebIoPi framework)

Users, Groups and Permission in Linux

Running Kmeans Spark on EC2 Documentation

UNIX and Linux Essentials Student Guide

File Upload Instructions Customer Access To Transcript Bulletin Publishing s FTP Site

Lab 1: Introduction to C, ASCII ART & the Linux Command Line

commandname flags arguments

Data Management at ARSC

CS Operating Systems, Fall 2018 Project #0 Description

Working with Basic Linux. Daniel Balagué

FILESYSTEMS. Mmmm crunchy

Access Permissions. Agenda. chmod Command (Relative Method) File / Directory Permissions

Lab 1 Introduction to UNIX and C

1Z Oracle Linux Fundamentals (Oracle Partner Network) Exam Summary Syllabus Questions

Chapter 8: Security under Linux

Bitnami MySQL for Huawei Enterprise Cloud

acmteam/unix.pdf How to manage your account (user ID, password, shell); How to compile C, C++, and Java programs;

Bitnami MariaDB for Huawei Enterprise Cloud

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

RH033 Red Hat Linux Essentials

Bitnami Tiny Tiny RSS for Huawei Enterprise Cloud

Bitnami Re:dash for Huawei Enterprise Cloud

Lab 0: Intro to running Jupyter Notebook on a Raspberry Pi

Computer Systems and Architecture

Intermediate Programming, Spring Misha Kazhdan

Ftp Command Line Manual Windows 7zip

Bitnami Dolibarr for Huawei Enterprise Cloud

CS 200. User IDs, Passwords, Permissions & Groups. User IDs, Passwords, Permissions & Groups. CS 200 Spring 2017

STA 303 / 1002 Using SAS on CQUEST

Goals for This Lecture:

Bitnami Piwik for Huawei Enterprise Cloud

Bitnami ez Publish for Huawei Enterprise Cloud

Quick Start Guide. by Burak Himmetoglu. Supercomputing Consultant. Enterprise Technology Services & Center for Scientific Computing

Basic File Attributes

Unix unzip zip compress uncompress zip zip zip zip Extracting zip Unzip ZIP Unix Unix zip extracting ZIP zip zip unzip zip unzip zip Unix zipped

How to Create a NetBeans PHP Project

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

CHAPTER 2. Troubleshooting CGI Scripts

You can access data using the FTP/SFTP protocol. This document will guide you in the procedures for configuring FTP/SFTP access.

New User Tutorial. OSU High Performance Computing Center

Setting up PuTTY. Version Updated for 2015 Fall (with corrections)

Setting up PuTTY. Software* Downoad PuTTY. Download PuTTY Download the putty.zip file. It contains several programs for SSH, SFTP, and SCP.

Unzip command in unix

Ftp Command Line Commands Linux Example Windows Putty

Quick Start Guide. by Burak Himmetoglu. Supercomputing Consultant. Enterprise Technology Services & Center for Scientific Computing

Introduction to UNIX I: Command Line 1 / 21

Flwrap Users Manual Generated by Doxygen

Operating System Interaction via bash

Basic File Attributes

FLWRAP Users Manual 1.3. Generated by Doxygen Wed Jun :40:27

Performing Maintenance Operations

First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion.

Bitnami OroCRM for Huawei Enterprise Cloud

Exploring UNIX: Session 3

Linux command line basics II: downloading data and controlling files. Yanbin Yin

When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used:

File Transfers. Contents

CENG 334 Computer Networks. Laboratory I Linux Tutorial

CS4350 Unix Programming. Outline

Ftp Command Line Commands Linux Example Windows Put

WebDAV. Overview. File Permissions and Management. Authentication Methods

A Big Step. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers

Linux Tutorial #1. Introduction. Login to a remote Linux machine. Using vim to create and edit C++ programs

INTRODUCTION TO BIOINFORMATICS

Session 1: Accessing MUGrid and Command Line Basics

CS 1301 Fall 2008 Lab 2 Introduction to UNIX

Bitnami ProcessMaker Community Edition for Huawei Enterprise Cloud

Quick Note 24. Extracting the debug.txt file from a TransPort. Digi Technical Support. February Page 1

Transcription:

Data Introduction to Unix and HPC (HPC for Wimps) Unit: Making a move (using FTP) Goals: Can login via Secure FTP and see home directory. Can transfer a file from local machine via FTP to home directory. Understands the difference between DOS and UNIX formats. Can convert files between DOS and UNIX formats. Can transfer a file created on the server back to local machine. 1

The Problem HPC We can interact with the command line over SSH. We can create directories (folders), move between them. We can create files and move them around, delete them, etc. We can run a program and get some output. But how can we Upload files, say our datasets, to the HPC machine? Download files, say the results of our analysis, from the HPC machine for further analysis locally? The Solution Well there are two to choose from: FTP = File Transfer Protocol SCP = Secure Copy (covered later) Let s start with FTP FTP Client FTP Server 2

Connecting to an FTP Server The HPC training machine runs an FTP server. To connect to it you need an FTP client, such as FileZilla. You tell the client which server to connect to: octane.intersect.org.au Port: 22 You authenticate with your username and password. All FTP communication to the HPC machine is secure. Exercise 1(a) Connecting to the training HPC machine 3

Transferring Files In the exercise to follow, we ll stick to using FileZilla, but most graphical FTP programs follow this analogy: FTP Client Local File System Remote File System drag and drop to transfer Text Files vs Binary Files Files Text Binary ASCII format Text files Datasets CSV XML 0s and 1s Word docs Images Executables 4

Text Files Teletype Machine Carriage Return Line Feed Text files contain special non-printing characters to signify new lines. Some systems use two characters: Carriage Return (CR) Line Feed (LF) Others use just one: Line Feed (LF) CR + LF Line 1 <CR><LF> Line 2 <CR><LF> Line 3 <CR><LF> Line 4 <CR><LF> Line 5 <CR><LF> DOS Windows LF Line 1 <LF> Line 2 <LF> Line 3 <LF> Line 4 <LF> Line 5 <LF> Unix Linux Mac OS X Because the training HPC machine is a Linux machine and our local machines run Windows, we need to convert our text files. 5

Exercise 1(b) Creating and Transferring files Unit: The Second Date (using SCP) Goals: Can use pscp to upload multiple files at once. Can use pscp to download multiple files at once. 6

SCP and PSCP Secure Copy (scp) is another way to transfer files to and from the HPC machine. Like SFTP, it is secure. Unlike SFTP, we ll be invoking it from the Windows command line SCP is non-interactive and, therefore, it can be scripted. SCP vs SFTP SCP does the same task as SFTP. Use whichever tool you feel more comfortable SCP Client with. SSH Server 7

PSCP An SCP Client Putty comes with an SCP client pscp.exe Putty Secure Copy. We ll be using PSCP in the exercises. To use it we need to open a Windows Command Prompt. An easy way to do this is to select Run from the Start menu and type cmd. Then click OK. Windows command prompt 8

PSCP Syntax Transfer file from local machine to the HPC machine: pscp <file_name.ext> <user_name>@octane.intersect.org.au:<dest_dir> The local file you want to copy Your training account user name Where you want the file to go on the HPC machine Exercise 2(a) Transferring files from your local machine to the training HPC machine using PSCP 9

PSCP Syntax Transfer file from the HPC machine to your local machine: pscp <user_name>@octane.intersect.org.au:<path/to/file_name.txt>. Your training account user name The path on the HPC machine to the file you want to copy Where to put the file locally. In this case. for the current working directory Exercise 2(b) Transferring files from the training HPC machine to your local machine using PSCP 10

Unit: (W)get it on! Using Wget Goals: Can use the basic wget syntax to download a dataset from the web. The Problem We want to use a dataset that s available on the web. How do we get it on to the HPC machine? By way of example, let s use a dataset about public toilet locations! It s available here: http://data.gov.au/dataset/national-publictoilet-map/ 11

We could, of course, do this: Local machine Web server hosting dataset 1. download dataset using web browser 2. save to downloads folder 3. upload via FTP HPC machine Entirely legitimate, just a bit involved But this is better HPC machine Web server hosting dataset download dataset directly to HPC machine using wget Download the file directly from the web server to the HPC machine 12

To do this: We need to be at the command line (i.e. logged into the HPC machine by SSH) Type: wget <URL_to_file> For example: wget http://raw.data.gov.au/610/toiletmap.zip This will download the dataset to your current working directory Unzip it! You ll notice that this file has a zip extension. This signifies that the file actually contains one or more files bundled for convenience and then (sometimes) compressed. It s called an archive. Other common archive formats have extensions tar, tgz, gz, bz2. It sounds confusing, but try these simple recipes 13

Recipes File Extension.zip.tar.tgz.gz.bz2 Command to unzip unzip <file_name>.zip tar xvf <file_name>.tar tar xzvf <file_name>.tgz gunzip <file_name>.gz bunzip2 <file_name>.bz2 If the file ends with an extension in the left column, use the corresponding command in the right column. Exercise 3(a) Downloading and unzipping a dataset 14

Unit: Things need to change, and quick! (Editing files in place) Goals: Can edit a file, save changes, and exit editor. The Problem We want to make a quick change to a Dataset Script 15

We could, of course, do this: But it can get cumbersome Instead we can edit in-situ using Nano Invoke with: nano <file_name.txt> Use the arrow keys to navigate your document Update the text by typing, backspace, etc. Use Control+O to save the file (^O). Use Control+X to quit (^X). 16

Exercise 4(a) Editing a file in-situ A word of caution As a matter of process it might be better to avoid editing in-situ on the HPC machine. There is a good chance your scripts and datasets will get out of sync with your local copies. This could generate confusion. Generally better to have a single point of truth. 17

Unit: What s mine is yours (Permissions and Ownership) Goals: Can make a file private. Can allow another to read and write to a file. Can make a script executable. Security Security is baked right into Unix All files and directories have security attributes Access can be limited by Read, Write, and Execute permissions Based on Owner Group World model: 18

For every file and directory: Owner Group World Can? Can't? r w x r w x r w x - - - - - - - - - execute Write Read execute Write Read execute Write Read Checking file permissions ls ls reveals all: Permissions for file: Owner Group World Owner Group 4 -rw-r--r-- 1 hpc20 hpc20 24 Jun 3 14:09 data-out.txt 4 -rw-r--r-- 1 hpc20 hpc20 28 Jun 3 14:09 data.txt 4 -rw-r--r-- 1 hpc20 hpc20 28 Jun 3 14:09 data1.txt 4 -rw-r--r-- 1 hpc20 hpc20 28 Jun 3 14:09 data2.txt 4 -rw-r--r-- 1 hpc20 hpc20 28 Jun 3 14:09 data3.txt 4 -rw-r--r-- 1 hpc20 hpc20 28 Jun 3 14:09 data4.txt 4 -rw-r--r-- 1 hpc20 hpc20 28 Jun 3 14:09 data5.txt It may come as a surprise, but by default the text files I created are world readable! 19

Handy commands Change Owner (chown) chown <new_owner> <file_name> Change Group (chgrp) chgrp <new_group> <file_name> Change Mode (chmod) chmod <new_mode> <file_name> We ll concentrate on the last one. Chmod <new_mode> format: chmod <new_mode> <file_name> References Operator Modes Who's to be affected? How affected? What affected? u + x u = user (the file's owner) g = group o = others (the world) a = ugo = all + = add specified modes - = remove specified modes = = set these exact modes r = read w = write x = execute 20

Chmod Recipes Command chmod o-rwx <file_name> chmod u+rwx,g-rwx,o-rwx <file_name> chmod a+w <file_name> chmod u+x <file_name> chmod go-w <file_name> chmod a=r <file_name> Result Forbid others (the world) to read, write and execute. Grant owner full permissions; deny all others access. Allow everyone (owner, group, and the world) write access. Allow the owner the execute permission. Forbid members of group and the world to write to file. Grant everyone read access (only) Exercise 5(a) Changing ownership and file permissions 21

Exercise 5(b) Making a script executable 22