Fail to do either one of those things, and you leave yourself open for trouble. Because of this, it’s imperative that you either always lock your desktop environment or remember to exit the SSH Agent session when you’re done. Should that be the case, anyone with the password to your desktop and the IP address/domain of your remote server can start a new remote session. You might have exited out of that SSH session, but failed to exit from the SSH Agent session. You’ve probably already figured out the caveat to using SSH Agent. This behavior will continue until you close the SSH Agent session with the exit command. Exit out of that remote session and attempt to log in again. This time, you won’t be prompted for your password or passphrase, you’ll simply be allowed in. You will be prompted for your SSH key passphrase.Īttempt to SSH to the remote server again. You might think, “Nothing has changed!” But it has. You will be returned an Agent PID and then back to your terminal. Now, how do we make use of ssh-agent? Easy. Now, when you attempt to SSH into the remote server, it will ask you for your SSH keyphrase instead of your user password. Where SERVER is the IP address or domain of the remote server. Once you’ve created your SSH key, you’ll then need to copy it to the server you’ll be logging into. From there, create a new SSH key with the command: To do this, head over to the machine you’ll be using to log into the remote server and open a terminal window. Once you’ve finished with your remote work, end the session and all is well.īut how do you work with this feature? Let me show you.īefore we do, we need to set up SSH key authentication. The ssh-agent tool, in conjunction with SSH key authentication, makes it possible for you to start a session and, as long as you are within that session, you can log in and out of a remote server without having to type an SSH password or authentication passphrase. Today, I want to introduce you to are two very specific SSH tools: ssh-agent and the SSH config files. Fortunately, SSH includes several features and add-ons to help simplify and secure its usage. You might be wondering how any tool that’s primarily used from the command line could be easy to work with. So good thing SSH is highly configurable and easy to work with. In fact, without SSH, working remotely on Linux machines, be they hosted in the cloud or an on-premise data center, would be a major challenge, if not entirely impossible. SSH is well-known for being a (mostly) secure protocol that not only makes remote administration/development simple, it’s also one of your best tools for interacting with your cloud-hosted virtual machines. Chances are pretty good you use Secure Shell to log into remote servers.
0 Comments
Leave a Reply. |