Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SSH and (not) FTP

SSH and (not) FTP

Confident Coding session - all things SSH plus a mix of other things including VPN, SFTP and SCP.


Lorna Mitchell

October 20, 2012

More Decks by Lorna Mitchell

Other Decks in Technology


  1. SSH, FTP and Friends

  2. About Me • Lorna Jane Mitchell • Web development consultant

    (mostly PHP) • Trainer, speaker • Author of PHP Master • http://lornajane.net
  3. The Plan • SSH • more SSH • Some Things

    That Are Not FTP
  4. SSH

  5. What is SSH? • SSH is Secure SHell • used

    for console access to servers • alternative to telnet
  6. How To SSH ssh username@host.com Hostname might be an IP

    address, depends if you have DNS
  7. SSH Clients For any *nix systems (including mac) use a

    terminal. For windows, use PuTTY http://lrnja.net/QDUNqx
  8. VPN

  9. VPN VPN Virtual Private Network • connects your machine to

    an additional network • gives access to local-only IPs • may need a token as well as credentials • be aware that ALL your traffic may get sent • once connected, no special powers are needed
  10. SSH Keys

  11. Public and Private Keys Common to use keys rather than

    username/password with SSH • You generate the keys • There will be a public key named something.pub • And a private key called just something • Share the public key anywhere you need access • Guard the private key with your life
  12. Sending and Storing Keys "Shall I send over my public

    key?" • Public keys are no use without private keys • Attach public keys to email • Or paste into textareas in forms • Private keys are as vital as passwords • Back them up! • Keep a copy somewhere safe
  13. Generating Keys ssh-keygen For windows, use PuTTYGen (http://lrnja.net/QDUNqx again) Challenge:

    Generate your own public/private key pair
  14. SSH Keys and GitHub Go to edit your profile, and

    choose "SSH Keys" from the left
  15. More SSH

  16. What if you want to have more than one key?

  17. SSH Identity Files We can specify which private key to

    use: ssh -i ~/.ssh./github_rsa git@github.com
  18. SSH Config SSH has a config file. We can use

    this to set per-host settings.
  19. Not FTP

  20. Why Not FTP? FTP has been superceeded by more secure

    options. Try SFTP or SCP • both usually available when you have SSH • both handled by FileZilla, Transmit and other popular clients
  21. SFTP SFTP Secure File Transfer Protocol • Secure and more

    robust file transfer than FTP • Uses your SSH credentials • URLs look like: sftp:// ...
  22. SCP SCP Secure CoPy Command-line program - works much like

    cp • Source and Target can be either local or remote • They are of the format username@server:path/to/file scp myfile lorna@remote.com:myfile scp myfile lorna@remote.com:
  23. Best Practice

  24. Some Tips! • Use version control, and deploy everything on

    each release • (as an emergency fallback, back everything up first) • Deploy as much as possible, as often as possible • Use version control ... more on git later!
  25. Questions?