SlideShare a Scribd company logo
Secure SHell
         Ecrypted command-line communication

cagriCOM08 | Information Security
Content
@     Definitions
@     What SSH Does
@     Core SSH programs
@     SSH Authentication Methods
     @     Password
     @     Public/private keypair
     @     Host-based authentication
@     SHH Basics
     @     Configuration Files [CF]
     @     Secure Logins
     @     Agent / Key Forwarding
     @     Enter Agent / Key Forwarding
     @     Port Forwarding
@     Conclusion

cagriCOM08 | Information Security
Definition-I                  Common used one


   «The Secure Shell Protocol (SSH) is a protocol
     for secure remote login and other secure
    network services over an insecure network»
                                                 Ylonen & Lonvick
                                                   Standards Track
SSH Communications Security Corp                    C. Lonvick, Ed.
                                                Cisco Systems, Inc.
                                                      January 2006


cagriCOM08 | Information Security
Definition-II                 More detatiled one

     «Secure Shell (SSH) is a cryptographic network protocol for
    secure data communication, remote shell services or command
       execution and other secure network services between two
   networked computers that connects, via a secure channel over an
                insecure network, a server and a client
     (running SSH server and SSH client programs, respectively).»
                                                        Ylonen & Lonvick
                                                         Standards Track
SSH Communications Security Corp                           wikipedia

cagriCOM08 | Information Security
Definition-III                 Structure




cagriCOM08 | Information Security
What SSH does



SecureSHell handles the set up and generation
      of an encrypted TCP connection.



cagriCOM08 | Information Security
What SSH does:                      which means…


.......
-SSH can handle secure remote logins (ssh)
-SSH can handle secure file copy (scp)
-SSH can even drive secure FTP (sftp)


cagriCOM08 | Information Security
Core SSH programs


                        ssh             client
                       sshd             server
                        sftc            transfer-line


               «if sshd is not running you will not
               be able to connect to it with ssh»
cagriCOM08 | Information Security
SSH Authentication Methods


$ Password
$ Public/private keypair
$ Host-based authentication


cagriCOM08 | Information Security
I       Password Authentication
      Example without SSH Keys                 Prompts for Password
     you                            server    you                  server




     ssh                            sshd     ssh                   sshd
                                             you>      ssh mac-1
                                             password: ****
                                             other>

cagriCOM08 | Information Security
II       Key-pair Authentication

  Example without SSH Keys
   you                              server



  ssh                           sshd




cagriCOM08 | Information Security
II       Key-pair Authentication

  Example without SSH Keys
   you             ?            server



  ssh                               sshd   server> ssh –keygen


 First of all Generate keys


cagriCOM08 | Information Security
II       Key-pair Authentication public/private key-pair

             you



~/.ssh/id_rsa
~/.ssh/id_rsa.pub




cagriCOM08 | Information Security
II       Key-pair Authentication public/private key-pair

                                Private Key: id_rsa
             you
                                            you


~/.ssh/id_rsa
~/.ssh/id_rsa.pub                   ~/.ssh/id_rsa
                                    ~/.ssh/id_rsa.pub

                                Private keys should be
                                kept secret, do not
                                share them with anyone

cagriCOM08 | Information Security
II       Key-pair Authentication public/private key-pair

                                Private Key: id_rsa      Public Key: id_rsa.pub
             you
                                            you                     you


~/.ssh/id_rsa
~/.ssh/id_rsa.pub                   ~/.ssh/id_rsa         ~/.ssh/id_rsa
                                    ~/.ssh/id_rsa.pub     ~/.ssh/id_rsa.pub

                                Private keys should be
                                                         Public keys are meant to
                                kept secret, do not
                                                         be shared.
                                share them with anyone

cagriCOM08 | Information Security
II       Key-pair Authentication public/private key-pair

                            Copy Public Key to server

               you                                      server



   ~/.ssh/id_rsa
   ~/.ssh/id_rsa.pub



cagriCOM08 | Information Security
II       Key-pair Authentication public/private key-pair

                            Copy Public Key to server

               you                                         server



   ~/.ssh/id_rsa
   ~/.ssh/id_rsa.pub                           ~/.ssh/authorized_keys



cagriCOM08 | Information Security
II       Key-pair Authentication public/private key-pair

                              No password required!

               you                                           server

                        ssh                           sshd

                                    you> ssh server
                                    other>


cagriCOM08 | Information Security
III       Host-based Authentication


•      Doesn’t require user credentials (password or key)
•      Provides trust based on hostname and user id
•      User id on both system has to be the same
•      Disabled by default -- not that useful



cagriCOM08 | Information Security
SSH Basics Configuration Files [CF]

                Server CF                               Client CF
 sshd config: /etc/sshd_config                      ssh config: /etc/ssh_config
                                          system-side

                                          user-specific ssh config: ~/.ssh/config




           Based on installation method system config locations may vary.
                example: macports installs in /opt/local/etc/ssh/
cagriCOM08 | Information Security
SSH Basics Secure Logins

           Login Example #1             Login Example #2
  ssh user@example.com                 ssh example.com
          Login Example #3              Login Example #4

 ssh -p 45000 example.com ssh example.com<command here>
                                      ssh example.com ls –l
                                    ssh example.com hostname
cagriCOM08 | Information Security
SSH Basics Agent / Key Forwarding
                                Example without SSH Keys
                                    server-1

     you

                                    server-2



cagriCOM08 | Information Security
SSH Basics Agent / Key Forwarding
                                    you> ssh server-1
                                     server-1           you> ssh server-1
                                                        password:
     you
                                                        Password required
                                     server-2



cagriCOM08 | Information Security
SSH Basics Agent / Key Forwarding
                                    you> ssh server-2
                                     server-1           you> ssh server-2
                                                        password:
     you
                                                        Password required
                                     server-2



cagriCOM08 | Information Security
SSH Basics Agent / Key Forwarding
 [updated example]                     you to server-1 to server-2
                                                            you> ssh -keygen

     you                                       server-1     Copy public key to
                                    Authorized_key          ~/.ssh/authorized_keys
                                                            on each remote host

   id_rsa.pub
   id_rsa                                     server-2
                                    Authorized_key
cagriCOM08 | Information Security
SSH Basics Agent / Key Forwarding
                                    you> ssh server-1
                                                        you> ssh server-1
                                                        server-1>
     you                                   server-1
                                                        Success


                                          server-2

cagriCOM08 | Information Security
SSH Basics Agent / Key Forwarding
                                    you> ssh server-2
                                                        you> ssh server-2
                                                        server-2>
     you                                   server-1
                                                        Success


                                          server-2

cagriCOM08 | Information Security
SSH Basics Agent / Key Forwarding
                               you to server-1 to server-2
                                                          you> ssh server-1
                                                          server-1>
     you                                       server-1   Success
                                    Authorized_key

                                                          you> ssh server-2
   id_rsa.pub                                             password>
   id_rsa                                     server-2    password required at
                                    Authorized_key
                                                          the second step!
cagriCOM08 | Information Security
SSH Basics Enter Agent / Key Forwarding
                            SSH Key Gets Forwarded



     you                              server-1


   id_rsa.pub
   id_rsa                            server-2

cagriCOM08 | Information Security
SSH Basics Enter Agent / Key Forwarding
                   Command Line Agent Forwarding
                                    ssh -A example.com




                         Use -A to explicitly turn off
                        forwarding for a ssh session.

cagriCOM08 | Information Security
SSH Basics Port Forwarding
                     Local Port Forwarding Example
       you                          server-1                server-2
                                          sshd       www




                                          Private Network


cagriCOM08 | Information Security
SSH Basics Port Forwarding
                             you to www on server-2
       you                          server-1                      server-2
                                                sshd       www

                                    public IP                     local IP
                                    local IP


                                                Private Network

cagriCOM08 | Information Security
SSH Basics Port Forwarding
                        Can’t access server-2 directly
       you                          server-1                      server-2
                                                sshd       www

                                    public IP                     local IP
                                    local IP


                                                Private Network

cagriCOM08 | Information Security
SSH Basics Port Forwarding
                         With Local Port Forwarding
       you                          server-1                 server-2
                                                sshd   www

                                    public IP                local IP
                                    local IP
 you> ssh -L 8000:server-2:80 server-1
 server-1>
 success
cagriCOM08 | Information Security
SSH Basics Port Forwarding
                                    A Tunnel is Made!
       you                            server-1                 server-2
                                                  sshd   www

                                      public IP                local IP
                                      local IP
 you> ssh -L 8000:server-2:80 server-1
 server-1>
 success
cagriCOM08 | Information Security
SSH Basics Port Forwarding
                   server-2 doesn’t have to run sshd
       you                          server-1                 server-2
                                                sshd   www
                                    public IP                local IP
                                    local IP




cagriCOM08 | Information Security
SSH Basics Port Forwarding
               Command Line Local Port Forwarding

        ssh -L localport:host:hostport example.com

 localport is the port on your machine,
 host is the remote server to tunnel to,
 hostport is the port on the remote server to tunnel to



cagriCOM08 | Information Security
SSH Basics Port Forwarding
                                    Sharing Tunnel
       you                           server-1                   server-2
                                                 sshd     www

                                     public IP                  local IP
                                     local IP

    another                   you> ssh -L 8000:server-2:80 -g server-1
                              server-1>
                              success
cagriCOM08 | Information Security
SSH Basics Port Forwarding
               Command Line Local Port Forwarding

      ssh -L localport:host:hostport -g example.com

 -g allows others to connect to your forwarded port




cagriCOM08 | Information Security
SSH Basics Port Forwarding
                                    Host Configured

 Host inspire.staging
 LocalForward 8000:server-2:80
 Per-User ~/.ssh/config
 System-wide /etc/ssh_config
 Friday, September



cagriCOM08 | Information Security
SSH Basics Port Forwarding
                             SSH Server has final say!

 AllowTcpForwarding no

 System-wide /etc/sshd_config
 Defaults to “yes” -- so pretty much ignore.




cagriCOM08 | Information Security
References
SSHSecure Shell forWorkstations Windows Client version 3.2.9 User Manual
Güvenli kanallardan iletişim ( SSH ) User Manual

http://en.wikipedia.org/wiki/Secure_SHell
http://en.wikipedia.org/wiki/Secure_channel
http://doctus.org/forum.php?s=ec689fc4bdb4dd0cc895cbdbd298cc3b
http://www.openssh.org/txt/
ftp://ftp.itu.edu.tr/Utility/SSH Secure Shell/
http://www.javakursu.net/sshnedir




cagriCOM08 | Information Security
Thanks For Attention
cagriCOM08

More Related Content

What's hot (20)

PPTX
Ssh (The Secure Shell)
Mehedi Farazi
 
PPTX
Ssh
Raghu nath
 
PPT
Secure Socket Layer
Naveen Kumar
 
PDF
SSH - Secure Shell
Souhaib El
 
PDF
Palo alto-review
Rayan Darine
 
PPTX
Secure Socket Layer (SSL)
Samip jain
 
PDF
Database Firewall with Snort
Narudom Roongsiriwong, CISSP
 
PDF
Linux Systems: Getting started with setting up an Embedded platform
Emertxe Information Technologies Pvt Ltd
 
PPTX
IP Sec - Basic Concepts
Avadhesh Agrawal
 
PPT
Basic Linux Internals
mukul bhardwaj
 
PDF
6 pan-os software update &amp; downgrade instruction
Mostafa El Lathy
 
PDF
IP Security
Dr.Florence Dayana
 
PDF
SIP Testing with FreeSWITCH
Moises Silva
 
PDF
7 palo alto security zones &amp; interfaces concepts
Mostafa El Lathy
 
PPTX
SSL TLS Protocol
Devang Badrakiya
 
PDF
OReilly-Web-Application-Security-NGINX.pdf
RazaMehmood7
 
PPT
SSH.ppt
joekr1
 
PPTX
Firewall
Nilkanth Shingala
 
PDF
Media Handling in FreeSWITCH
Moises Silva
 
PPTX
Transport layer security (tls)
Kalpesh Kalekar
 
Ssh (The Secure Shell)
Mehedi Farazi
 
Secure Socket Layer
Naveen Kumar
 
SSH - Secure Shell
Souhaib El
 
Palo alto-review
Rayan Darine
 
Secure Socket Layer (SSL)
Samip jain
 
Database Firewall with Snort
Narudom Roongsiriwong, CISSP
 
Linux Systems: Getting started with setting up an Embedded platform
Emertxe Information Technologies Pvt Ltd
 
IP Sec - Basic Concepts
Avadhesh Agrawal
 
Basic Linux Internals
mukul bhardwaj
 
6 pan-os software update &amp; downgrade instruction
Mostafa El Lathy
 
IP Security
Dr.Florence Dayana
 
SIP Testing with FreeSWITCH
Moises Silva
 
7 palo alto security zones &amp; interfaces concepts
Mostafa El Lathy
 
SSL TLS Protocol
Devang Badrakiya
 
OReilly-Web-Application-Security-NGINX.pdf
RazaMehmood7
 
SSH.ppt
joekr1
 
Media Handling in FreeSWITCH
Moises Silva
 
Transport layer security (tls)
Kalpesh Kalekar
 

Viewers also liked (19)

PDF
PHP Secure Programming
Balavignesh Kasinathan
 
PPT
Practical Example of grep command in unix
Javin Paul
 
PDF
Web Application Security: Introduction to common classes of security flaws an...
Thoughtworks
 
PDF
How to Setup A Pen test Lab and How to Play CTF
n|u - The Open Security Community
 
KEY
Sed & awk the dynamic duo
Joshua Thijssen
 
PDF
Unix Command Line Productivity Tips
Keith Bennett
 
PPT
Learning sed and awk
Yogesh Sawant
 
PPTX
Practical unix utilities for text processing
Anton Arhipov
 
PDF
class12_Networking2
T. J. Saotome
 
PPT
Unix command-line tools
Eric Wilson
 
PDF
Web Application Security with PHP
jikbal
 
PDF
Defeating The Network Security Infrastructure V1.0
Philippe Bogaerts
 
PDF
SSH
Zach Dennis
 
PDF
Virtual Security Lab Setup - OWASP Broken Web Apps, Webgoat, & ZAP
Michael Coates
 
PDF
Top 100 Linux Interview Questions and Answers 2014
iimjobs and hirist
 
ODT
RHCE FINAL Questions and Answers
Radien software
 
PDF
Linux Performance Analysis: New Tools and Old Secrets
Brendan Gregg
 
PDF
Linux Systems Performance 2016
Brendan Gregg
 
PPTX
Broken Linux Performance Tools 2016
Brendan Gregg
 
PHP Secure Programming
Balavignesh Kasinathan
 
Practical Example of grep command in unix
Javin Paul
 
Web Application Security: Introduction to common classes of security flaws an...
Thoughtworks
 
How to Setup A Pen test Lab and How to Play CTF
n|u - The Open Security Community
 
Sed & awk the dynamic duo
Joshua Thijssen
 
Unix Command Line Productivity Tips
Keith Bennett
 
Learning sed and awk
Yogesh Sawant
 
Practical unix utilities for text processing
Anton Arhipov
 
class12_Networking2
T. J. Saotome
 
Unix command-line tools
Eric Wilson
 
Web Application Security with PHP
jikbal
 
Defeating The Network Security Infrastructure V1.0
Philippe Bogaerts
 
Virtual Security Lab Setup - OWASP Broken Web Apps, Webgoat, & ZAP
Michael Coates
 
Top 100 Linux Interview Questions and Answers 2014
iimjobs and hirist
 
RHCE FINAL Questions and Answers
Radien software
 
Linux Performance Analysis: New Tools and Old Secrets
Brendan Gregg
 
Linux Systems Performance 2016
Brendan Gregg
 
Broken Linux Performance Tools 2016
Brendan Gregg
 
Ad

Similar to Secure SHell (20)

PDF
SSH how to 2011
Chris Hales
 
PDF
(Mis)trusting and (ab)using ssh
Tiago Henriques
 
PDF
(Mis)trusting and (ab)using ssh
morisson
 
PDF
Open ssh cheet sheat
Piyush Mittal
 
PPT
Presentation nix
fangjiafu
 
PPT
Presentation nix
fangjiafu
 
PDF
SSH.pdf
AnisSalhi3
 
PPTX
Remote Accesserver, Introduction(Part1).pptx
songsavoeun571
 
KEY
Intro to SSH
JP Bourget
 
PPTX
Logging remotely open ssh
Visha Parasuraman
 
PDF
tutorial-ssh.pdf
NigussMehari4
 
PDF
Configuring Secure Shell on Routers and Switches Running Cisco IOS - Cisco Sy...
Hoàng Hải Nguyễn
 
PPT
Ssh
gh02
 
PPTX
A presentation on SSH (Secure Shell or Secure Socket Shell)
Prabhat K.C.
 
DOCX
Administering Remote System in Linux
Mohammed Yazdani
 
ZIP
Sshstuff
Matt Rae
 
PPTX
SSh_part_1.pptx
Shelly119532
 
PDF
Ssh cookbook
Jean-Marie Renouard
 
PDF
Ssh cookbook v2
Jean-Marie Renouard
 
PDF
OpenSSH: keep your secrets safe
Giovanni Bechis
 
SSH how to 2011
Chris Hales
 
(Mis)trusting and (ab)using ssh
Tiago Henriques
 
(Mis)trusting and (ab)using ssh
morisson
 
Open ssh cheet sheat
Piyush Mittal
 
Presentation nix
fangjiafu
 
Presentation nix
fangjiafu
 
SSH.pdf
AnisSalhi3
 
Remote Accesserver, Introduction(Part1).pptx
songsavoeun571
 
Intro to SSH
JP Bourget
 
Logging remotely open ssh
Visha Parasuraman
 
tutorial-ssh.pdf
NigussMehari4
 
Configuring Secure Shell on Routers and Switches Running Cisco IOS - Cisco Sy...
Hoàng Hải Nguyễn
 
Ssh
gh02
 
A presentation on SSH (Secure Shell or Secure Socket Shell)
Prabhat K.C.
 
Administering Remote System in Linux
Mohammed Yazdani
 
Sshstuff
Matt Rae
 
SSh_part_1.pptx
Shelly119532
 
Ssh cookbook
Jean-Marie Renouard
 
Ssh cookbook v2
Jean-Marie Renouard
 
OpenSSH: keep your secrets safe
Giovanni Bechis
 
Ad

Recently uploaded (20)

PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Biography of Daniel Podor.pdf
Daniel Podor
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 

Secure SHell

  • 1. Secure SHell Ecrypted command-line communication cagriCOM08 | Information Security
  • 2. Content @ Definitions @ What SSH Does @ Core SSH programs @ SSH Authentication Methods @ Password @ Public/private keypair @ Host-based authentication @ SHH Basics @ Configuration Files [CF] @ Secure Logins @ Agent / Key Forwarding @ Enter Agent / Key Forwarding @ Port Forwarding @ Conclusion cagriCOM08 | Information Security
  • 3. Definition-I Common used one «The Secure Shell Protocol (SSH) is a protocol for secure remote login and other secure network services over an insecure network» Ylonen & Lonvick Standards Track SSH Communications Security Corp C. Lonvick, Ed. Cisco Systems, Inc. January 2006 cagriCOM08 | Information Security
  • 4. Definition-II More detatiled one «Secure Shell (SSH) is a cryptographic network protocol for secure data communication, remote shell services or command execution and other secure network services between two networked computers that connects, via a secure channel over an insecure network, a server and a client (running SSH server and SSH client programs, respectively).» Ylonen & Lonvick Standards Track SSH Communications Security Corp wikipedia cagriCOM08 | Information Security
  • 5. Definition-III Structure cagriCOM08 | Information Security
  • 6. What SSH does SecureSHell handles the set up and generation of an encrypted TCP connection. cagriCOM08 | Information Security
  • 7. What SSH does: which means… ....... -SSH can handle secure remote logins (ssh) -SSH can handle secure file copy (scp) -SSH can even drive secure FTP (sftp) cagriCOM08 | Information Security
  • 8. Core SSH programs ssh client sshd server sftc transfer-line «if sshd is not running you will not be able to connect to it with ssh» cagriCOM08 | Information Security
  • 9. SSH Authentication Methods $ Password $ Public/private keypair $ Host-based authentication cagriCOM08 | Information Security
  • 10. I Password Authentication Example without SSH Keys Prompts for Password you server you server ssh sshd ssh sshd you> ssh mac-1 password: **** other> cagriCOM08 | Information Security
  • 11. II Key-pair Authentication Example without SSH Keys you server ssh sshd cagriCOM08 | Information Security
  • 12. II Key-pair Authentication Example without SSH Keys you ? server ssh sshd server> ssh –keygen First of all Generate keys cagriCOM08 | Information Security
  • 13. II Key-pair Authentication public/private key-pair you ~/.ssh/id_rsa ~/.ssh/id_rsa.pub cagriCOM08 | Information Security
  • 14. II Key-pair Authentication public/private key-pair Private Key: id_rsa you you ~/.ssh/id_rsa ~/.ssh/id_rsa.pub ~/.ssh/id_rsa ~/.ssh/id_rsa.pub Private keys should be kept secret, do not share them with anyone cagriCOM08 | Information Security
  • 15. II Key-pair Authentication public/private key-pair Private Key: id_rsa Public Key: id_rsa.pub you you you ~/.ssh/id_rsa ~/.ssh/id_rsa.pub ~/.ssh/id_rsa ~/.ssh/id_rsa ~/.ssh/id_rsa.pub ~/.ssh/id_rsa.pub Private keys should be Public keys are meant to kept secret, do not be shared. share them with anyone cagriCOM08 | Information Security
  • 16. II Key-pair Authentication public/private key-pair Copy Public Key to server you server ~/.ssh/id_rsa ~/.ssh/id_rsa.pub cagriCOM08 | Information Security
  • 17. II Key-pair Authentication public/private key-pair Copy Public Key to server you server ~/.ssh/id_rsa ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys cagriCOM08 | Information Security
  • 18. II Key-pair Authentication public/private key-pair No password required! you server ssh sshd you> ssh server other> cagriCOM08 | Information Security
  • 19. III Host-based Authentication • Doesn’t require user credentials (password or key) • Provides trust based on hostname and user id • User id on both system has to be the same • Disabled by default -- not that useful cagriCOM08 | Information Security
  • 20. SSH Basics Configuration Files [CF] Server CF Client CF sshd config: /etc/sshd_config ssh config: /etc/ssh_config system-side user-specific ssh config: ~/.ssh/config Based on installation method system config locations may vary. example: macports installs in /opt/local/etc/ssh/ cagriCOM08 | Information Security
  • 21. SSH Basics Secure Logins Login Example #1 Login Example #2 ssh [email protected] ssh example.com Login Example #3 Login Example #4 ssh -p 45000 example.com ssh example.com<command here> ssh example.com ls –l ssh example.com hostname cagriCOM08 | Information Security
  • 22. SSH Basics Agent / Key Forwarding Example without SSH Keys server-1 you server-2 cagriCOM08 | Information Security
  • 23. SSH Basics Agent / Key Forwarding you> ssh server-1 server-1 you> ssh server-1 password: you Password required server-2 cagriCOM08 | Information Security
  • 24. SSH Basics Agent / Key Forwarding you> ssh server-2 server-1 you> ssh server-2 password: you Password required server-2 cagriCOM08 | Information Security
  • 25. SSH Basics Agent / Key Forwarding [updated example] you to server-1 to server-2 you> ssh -keygen you server-1 Copy public key to Authorized_key ~/.ssh/authorized_keys on each remote host id_rsa.pub id_rsa server-2 Authorized_key cagriCOM08 | Information Security
  • 26. SSH Basics Agent / Key Forwarding you> ssh server-1 you> ssh server-1 server-1> you server-1 Success server-2 cagriCOM08 | Information Security
  • 27. SSH Basics Agent / Key Forwarding you> ssh server-2 you> ssh server-2 server-2> you server-1 Success server-2 cagriCOM08 | Information Security
  • 28. SSH Basics Agent / Key Forwarding you to server-1 to server-2 you> ssh server-1 server-1> you server-1 Success Authorized_key you> ssh server-2 id_rsa.pub password> id_rsa server-2 password required at Authorized_key the second step! cagriCOM08 | Information Security
  • 29. SSH Basics Enter Agent / Key Forwarding SSH Key Gets Forwarded you server-1 id_rsa.pub id_rsa server-2 cagriCOM08 | Information Security
  • 30. SSH Basics Enter Agent / Key Forwarding Command Line Agent Forwarding ssh -A example.com Use -A to explicitly turn off forwarding for a ssh session. cagriCOM08 | Information Security
  • 31. SSH Basics Port Forwarding Local Port Forwarding Example you server-1 server-2 sshd www Private Network cagriCOM08 | Information Security
  • 32. SSH Basics Port Forwarding you to www on server-2 you server-1 server-2 sshd www public IP local IP local IP Private Network cagriCOM08 | Information Security
  • 33. SSH Basics Port Forwarding Can’t access server-2 directly you server-1 server-2 sshd www public IP local IP local IP Private Network cagriCOM08 | Information Security
  • 34. SSH Basics Port Forwarding With Local Port Forwarding you server-1 server-2 sshd www public IP local IP local IP you> ssh -L 8000:server-2:80 server-1 server-1> success cagriCOM08 | Information Security
  • 35. SSH Basics Port Forwarding A Tunnel is Made! you server-1 server-2 sshd www public IP local IP local IP you> ssh -L 8000:server-2:80 server-1 server-1> success cagriCOM08 | Information Security
  • 36. SSH Basics Port Forwarding server-2 doesn’t have to run sshd you server-1 server-2 sshd www public IP local IP local IP cagriCOM08 | Information Security
  • 37. SSH Basics Port Forwarding Command Line Local Port Forwarding ssh -L localport:host:hostport example.com localport is the port on your machine, host is the remote server to tunnel to, hostport is the port on the remote server to tunnel to cagriCOM08 | Information Security
  • 38. SSH Basics Port Forwarding Sharing Tunnel you server-1 server-2 sshd www public IP local IP local IP another you> ssh -L 8000:server-2:80 -g server-1 server-1> success cagriCOM08 | Information Security
  • 39. SSH Basics Port Forwarding Command Line Local Port Forwarding ssh -L localport:host:hostport -g example.com -g allows others to connect to your forwarded port cagriCOM08 | Information Security
  • 40. SSH Basics Port Forwarding Host Configured Host inspire.staging LocalForward 8000:server-2:80 Per-User ~/.ssh/config System-wide /etc/ssh_config Friday, September cagriCOM08 | Information Security
  • 41. SSH Basics Port Forwarding SSH Server has final say! AllowTcpForwarding no System-wide /etc/sshd_config Defaults to “yes” -- so pretty much ignore. cagriCOM08 | Information Security
  • 42. References SSHSecure Shell forWorkstations Windows Client version 3.2.9 User Manual Güvenli kanallardan iletişim ( SSH ) User Manual http://en.wikipedia.org/wiki/Secure_SHell http://en.wikipedia.org/wiki/Secure_channel http://doctus.org/forum.php?s=ec689fc4bdb4dd0cc895cbdbd298cc3b http://www.openssh.org/txt/ ftp://ftp.itu.edu.tr/Utility/SSH Secure Shell/ http://www.javakursu.net/sshnedir cagriCOM08 | Information Security