Recent Changes - Search:

Basics

Languages

Tools

OS

Resources

PmWiki

pmwiki.org

edit SideBar

SSH-Keys

Setting up ssh keys allows you to log onto a remote computer without entering a password. Creating the key can be done from the command line of your local computer with:

ssh-keygen -t rsa

which will create a new RSA private key (the metaphorical key) and a RSA public key (the metaphorical lock). (Note: you can use other encryption methods, by specifying them instead of rsa in the above) When entering the above command, you will be asked where you would like to save the keys. The default location works fine for simple cases, but if you want to have multiple keys for multiple purposes, this is where you differentiate them. It will also ask if you want a passphrase. If you do supply a passphrase, you will need it to log in the remote computer (thus making the whole thing pointless if you are trying to get rid of having to enter a password, unless you use a SSH-Agent).

Once you have the keys, you need to setup the public key on the remote computer. This is essentially installing the "lock" on the door of the remote computer, so that you can get in using your new key. The simplest way to do so is with:

ssh-copy-id username@server

where username is the username you normally use to log in the remote computer and server is the ip address (or URL) of the remote computer.

If you have multiple keys and want to install a specific one, you can pick which one to use with:

ssh-copy-id -i key_id username@server

where key_id is the name of the key to install.

You will then be prompted to ssh to the remote server to check what was installed. If you have not used a passphrase, this will be the first time you can ssh to the remote computer without entering anything but:

ssh username@server

Edit - History - Print - Recent Changes - Search
Page last modified on July 12, 2018, at 01:52 PM