From the course: Learning SSH

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Managing and using key pairs

Managing and using key pairs - SSH Tutorial

From the course: Learning SSH

Managing and using key pairs

- [Instructor] To use a key to connect to an SSH server, we'll need to share our public key with the server. There are three ways we might do this, and which method we choose is based on how much access we have to the server. If we already have access to the server using password authentication or access using another key, we can use the command ssh-copy-id to send our public key to the server and have it install our key where it needs to be stored. This tool is useful if we're the server administrator and have just set it up with password access temporarily in order to get going with the goal of then switching to only allowing keys soon after, or if we're rotating an existing key with a new one. This method automates a manual task of copying the of our public key into a file called authorized_keys in the .ssh directory in our home directory, and setting its permissions accordingly. We can also follow that manual pattern…

Contents