Skip to content
Permalink
Browse files
added ssh password free login
  • Loading branch information
aa7401 committed Aug 6, 2019
1 parent 3d3ae92 commit 1f0a3b84f219dec6b45f134cd424481526434569
Showing 1 changed file with 31 additions and 0 deletions.
@@ -131,3 +131,34 @@ pi@doej:~ $
If you are using Windows 10 you will need to download the [Putty](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) application. After launch you need to enter the hostname and user credentials in the appropriate boxes. Once logged in, Putty behaves like a standard terminal window.

If the credentials are correct you are now connected to the server and all the commands you enter will be run on it. To quit and return to your computer enter the `exit` command.

## 5 SSH Login Without Password

Now we have enabled remote login we will finish by setting up ssh access that won't prompt you for your password! To do this you will need to complete the following steps (Only tested on MacOS and Ubuntu):

The first step is to check your local computer (the one you will be connecting from) to see if you have a pair of authentication keys. These will be in a hidden directory called `.ssh` located in your home directory.

```shell
$ test -f ~/.ssh/id_rsa ; echo $?
0
```

A non-zero value indicates an error so, if the command returns `1` you will need to generate the keys:

```
ssh-keygen -t rsa
```

Accept all the default options (keep pressing the enter key).

Now copy the contents of the `id_rsa.pub` file to the clipboard. On MacOS you can use the command `pbcopy ~/.ssh/id_rsa.pub`. On linux display the contents of the file using `less ~/.ssh/id_rsa.pub` then select and copy.

Now log into the Raspberry Pi and create a file called `authorized_keys`:

```shell
nano ~/.ssh/authorized_keys
```

In the nano editor paste in the public key from your local computer then save (`ctrl+O`) and quit (`ctrl+X`).

If you log back out the raspberry pi then try logging in again you will not be prompted for the password!

0 comments on commit 1f0a3b8

Please sign in to comment.