SSH and keys. Network Startup Resource Center

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

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

2-1-1 ssh Secure SHell

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

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

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

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

ssh and handson Matsuzaki maz Yoshinobu 1

Security with SSH. Network Startup Resource Center

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

This is a guide about using Putty on Windows with OpenSSH on Linux. You would learn about how to:

2-1-1 ssh Secure SHell

Linux Network Administration

Using keys with SSH Rob Judd

Some SSH tips & tricks you may enjoy (plus, iptables)

CPSC 467: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security

LAB :: Secure SHell (SSL)

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

Titan FTP Server SSH Host Key Authentication with SFTP

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

If you prefer to use your own SSH client, configure NG Admin with the path to the executable:

SSH SECURITY. If you ve never used SSH before on a computer, the chances are very high that

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

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

Configuring SSH Public Key Authentication

Common Report Engine Leipzig. Ref. 0003

SEEM4540 Open Systems for E-Commerce Lecture 03 Internet Security

Security with SSH. SANOG VI IP Services Workshop. Hervey Allen

Topics. Security with SSH. Cryptographic Methods and Apps. SSH Application Layer Security

Setting up a Chaincoin Masternode

SE420 Software Quality Assurance

File transfer clients manual File Delivery Services

Configuring SSH and Telnet

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


UL HPC School 2017[bis] PS1: Getting Started on the UL HPC platform

SSH. Partly a tool, partly an application Features:

Connect using Putty to a Linux Server

Expedition. Hardening Guide Version Palo Alto Networks, Inc.

UNIVERSITY OF CYPRUS Computer Science Department

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

curl Manager Manual Contents Intro

Build

Lecture 30. Cryptography. Symmetric Key Cryptography. Key Exchange. Advanced Encryption Standard (AES) DES. Security April 11, 2005

Application Note. Configuring SSH on Vocality units. Software From V07_04_01. Revision v1.5

TELE301 Lab16 - The Secure Shell

Certifying Program Execution with Secure Processors. Benjie Chen Robert Morris Laboratory for Computer Science Massachusetts Institute of Technology

SSH: Using and Securing

Mango AM335x (AM335X) Gbit. Lan 이용복사테스트. Crazy Embedded Laboratory

SECURITY STORY WE NEVER SEE, TOUCH NOR HOLD YOUR DATA

File Encryption. Steven M. Bellovin

Nigori: Storing Secrets in the Cloud. Ben Laurie

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

No More Passwords (with SSH)

MU2b Authentication, Authorization and Accounting Questions Set 2

An Overview of the Secure Shell (SSH)

HOW TO SECURELY CONFIGURE A LINUX HOST TO RUN CONTAINERS

CS530 Authentication

Using Encryption CHAPTER. In this chapter, you will learn about How encryption works Encrypting remote access with OpenSSH Encrypting Linux files

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

Table of Contents 1 SSH Configuration 1-1

Remote Access Via SSH

Fundamentals of Linux Platform Security

Ross Whetten, North Carolina State University

Amazon Web Services Hands on EC2 December, 2012

Man In The Middle Project completed by: John Ouimet and Kyle Newman

Cloud Computing. Luigi Santangelo Department of Computer Engineering University of Pavia

Congratulations! You just ordered IdentaMaster software package featuring Biometric login, File/Folder Encryption and Entire Drive Encryption.

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.

Security Hardening Checklist for Cisco Routers/Switches in 10 Steps

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

Secure SHell Explained!

Bluetooth low energy security, how good is it? Petter Myhre Bluetooth World, San Jose March 2017

Tectia Client/Server 6.4 (Windows) Quick Start Guide

Configuring the JUNOS Software the First Time on a Router with a Single Routing Engine

How to Back Up and Restore Application Consistent Snapshots of SQL and Exchange Databases

FileVault 2 Decoded. Rich Trouton Howard Hughes Medical Institute, Janelia Farm Research Campus

Factotum Sep. 24, 2007

Linux Systems Security. Access Control and Authentication NETS1028 Fall 2016

Enable SSH Access on the Tenable Virtual Appliance (4.4.x-4.7.x) Last Revised: February 27, 2018

Contents. Configuring SSH 1

The OpenSSH Protocol under the Hood

Sentry Power Manager (SPM) Software Security

Computer Security. 08. Authentication. Paul Krzyzanowski. Rutgers University. Spring 2018

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

Deprecating the Password: A Progress Report. Dr. Michael B. Jones Identity Standards Architect, Microsoft May 17, 2018

Computer Security 3/20/18

Crypto Programming with OpenSSL. (Creating Certificates)

F-Secure SSH and OpenSHH. VPN Authentication Configuration Guide. Copyright 2005 CRYPTOCard Corporation All Rights Reserved

Security context. Technology. Solution highlights

Encrypting external USB drive on Linux

Configuring SSH and Telnet

Man in the Middle Attacks and Secured Communications

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

Build your own Lightweight Webserver - Hands-on I - Information Network I. Marius Georgescu. Internet Engineering Laboratory. 17 Apr

COS 318: Operating Systems. File Systems. Topics. Evolved Data Center Storage Hierarchy. Traditional Data Center Storage Hierarchy

Cryptography for Software and Web Developers

Protocol Comparisons: OpenSSH, SSL/TLS (AT-TLS), IPSec

Introduction to Information Security Prof. V. Kamakoti Department of Computer Science and Engineering Indian Institute of Technology, Madras

Transcription:

SSH and keys Network Startup Resource Center www.nsrc.org These materials are licensed under the Creative Commons Attribution-NonCommercial 4.0 International license (http://creativecommons.org/licenses/by-nc/4.0/)

Passwords are bad! A large proportion of security failures are due to passwords Users choose poor passwords Users write them down or share them Passwords can be guessed or brute-forced Passwords can be sniffed or key-logged People hate forced password changes and password complexity tests, and will work around them

SSH and system administration SSH gives you remote command-line access to systems Therefore a very attractive target for attackers Traffic is encrypted, which at least makes it hard to sniff passwords off the network Much better than telnet But in addition, SSH allows you to use cryptographic keys instead of passwords

Using crypto keys with SSH 1. Generate a Private/Public key pair 2. Copy the public key onto each of the systems you want to be able to log into It goes into $HOME/.ssh/authorized_keys 3. Log in with ssh, using your private key to prove your identity to the other system, instead of a password

User authentication with keys Connect Out of Private Band Public User proves they possess the matching private key /home/xxx/.ssh/ authorized_keys Public

Generating a key pair This is a one-time operation For Windows/putty: use puttygen.exe For Linux and OSX: use ssh-keygen There are four different key types rsa (v1 obsolete), rsa (v2), dsa, ecdsa We recommend you use RSA version 2 with a key length of 2048 bits (-t rsa -b 2048) You get a private key and a related public key

OpenSSH public key looks like this One very long line of text ssh-rsa AAAAB3NzaC1... you@yourmachine Key type Key data Label (identifier) Safe for copy-paste (but beware line wrap) puttygen has a different native format but can also export the above format

Understand the difference! Your private key is like the Crown Jewels Your public key is like a photograph of the Crown Jewels Which of these would you be happy to send via the postal service? :-) Never give your private key to anyone else Never send your private key via E-mail Should you need to transfer it, do so via a secure channel like scp or sftp

Keeping your private key safe Keep it on the machine where it was generated usually your laptop plus a secure backup, e.g. USB key in a safe Protect it with a strong passphrase The key is actually stored encrypted on your hard disk; the passphrase decrypts it So an attacker would need both to steal the key file and know your passphrase "2-factor authentication": something you have, and something you know

Disabling passwords over SSH Once you have key authentication working, you can disable fallback to password auth # editor /etc/ssh/sshd_config PasswordAuthentication no ChallengeResponseAuthentication no PermitRootLogin without-password - or -PermitRootLogin no # service ssh restart

Man-in-the-middle attacks How do you know you did not actually connect to someone else, who is decrypting your traffic and re-encrypting it to the remote host? xehlhxn j;ijf ure hq ewioihbyugi owef;glgu ;qfhhlqwcwiefxweix iw xfenowixfuewg2384

Host keys Solution: the host you are connecting to, also has its own key The host proves its own identity to you each time you connect The first time you connect, you will be shown the host's "fingerprint" (hash of public key) If you've ever used SSH, even with passwords, you will have seen this prompt Future connections will check that the same host key is seen

Host key verification If later there is a man-in-the-middle, on connection your ssh client will see the MITM's key instead of the host's key It won't match, you will get an error and the connection is dropped Questions: What happens if you reinstall the host's OS? What effect might this have on your users? How are you going to deal with it?

Questions? Now do the exercise: SSH with public key authentication

SSH Agent Having to enter your passphrase every time you log in is tedious However there is a simple solution to this: the SSH Agent Once you have decrypted your private key once with your passphrase, the Agent keeps the decrypted key in RAM Subsequent logins don't prompt you at all This makes SSH + keys very convenient!

Installing SSH agent For Windows/putty: download pageant.exe Start it Select your private key file Enter your passphrase OSX: already has it Linux with Unity/Gnome/KDE: already has it

Multi-hop authentication Sometimes it is necessary to ssh into host X, and then ssh from host X to host Y e.g. due to network ACLs or because host Y is on a private IP address or because you are running some sysadmin tool on host X which needs to log in to host Y ssh ssh host X host Y

Agent forwarding You may be tempted to copy your private key from your laptop to host X, but DON'T! There is a better way: turn on Agent Forwarding when you connect to host X Host Y will try to authenticate from host X, and host X will relay the request back to the origin ssh Private ssh

Summary SSH + key is very secure Disable password authentication to get max benefit SSH + key + agent is very convenient Type passphrase just once at start of day No need to type passwords each time you login No need to regularly change passwords across many hosts Agent forwarding permits multi-hop logins You need to deploy this!

Questions? Now do the exercise: SSH with agent