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

Basics of SSH and key-pair | Ujan | Gurzu

Gurzu
January 03, 2024

Basics of SSH and key-pair | Ujan | Gurzu

Ujan talks about the basics of SSH and key-pair in this episode of knowledge ketchup.

www.gurzu.com

Gurzu

January 03, 2024
Tweet

More Decks by Gurzu

Other Decks in Technology

Transcript

  1. SSH (Secure Shell) 1. Managing networks, configuration and operating system.

    2. Used by many file transfer tools and configuration management tools. 3. Mainly used to connect to remote devices. 4. Port 22. 3
  2. Why Public Key authentication ? • one of the way

    to authenticate yourself other than password based authentication • provides cryptographic strength that even extremely long passwords can not offer • free users from remembering complicated passwords • Allows automated, passwordless login to perform many tasks on the server. 4
  3. Key pair - Public and Private • Generating a ssh

    key pair includes two keys: public key and private key ◦ Public Key ▪ copy into the server, specifically in authorized_key file. ◦ Private Key ▪ Remains only to user ▪ It is the proof of the users’ identity ▪ Also known as identity key • most common algorithm are RSA • New algorithm is used: Ed25519 5
  4. Uses of SSH • Remote Shell Access ◦ ssh username@hostname

    • Secure File Transfer (SCP) ◦ scp local_file username@hostname:remote_path • Secure File Synchronization (rsync) ◦ rsync -avz -e "ssh" source_directory username@hostname:destination_directory • Tunneling and Port Forwarding ◦ ssh -L local_port:remote_host:remote_port username@hostname 7
  5. Uses of SSH • Execute remote commands ◦ ssh username@hostname

    "command" • Git and Version Controls ◦ git@hostname:username/repo.git • Secure File Transfer (SFTP) ◦ sftp username@hostname 8
  6. Securing devices • Disabling root login • Disabling password authentication

    (if using keys) • Securing private key • Changing ssh port • Limit user access Note: ssh configuration file path - /etc/ssh/sshd_config 9