Key generation

Raspberry Pi configuration guide to use SSH Key authentication with the RaspController application

To generate new RSA SSH key type the following command in the Raspberry Pi terminal:

ssh-keygen -t rsa -m PEM

confirms the name of the file with ENTER and enter a passphrase (recommended).


For Ed25519 keys type:

ssh-keygen -t ed25519 -m PEM


If you don’t use any passphrase you need to edit the file /etc/ssh/sshd_config with 'PermitEmptyPasswords yes'.


Edit the file ‘sshd_config’:

sudo nano /etc/ssh/sshd_config

edit the line ‘AuthorizedKeysFile’ removing the # symbol (if present) and adding:


(for the Ed25519 key the file name is ‘’)


Save the content of the file pressing CTRL + X (to exit from nano), respond “Yes” at the request of saving, then confirm with ENTER.

Now reboot the ssh service with:

sudo /etc/init.d/ssh restart

or reboot the Raspberry Pi.


Add a new device into the RaspController application and copy the ‘id_rsa’ file content generated by the Raspberry Pi.

Only for user other than 'pi'

If you are using a user other than the classic ‘pi’ remove the password prompt from this user.

Create a custom sudoers file using (replace bob with your user):

sudo visudo /etc/sudoers.d/010_bob-nopasswd

Insert the following contents on a single line:


Save the file and exit.


Raspberry Pi documentation:

Only for root user

The previously created keys are placed in the ‘pi’ user folder, now you also need to copy the public key in the root directory.

Create the ssh directory (if not exists) [~ is Alt Gr + ì]:

sudo mkdir ~root/.ssh

Copy the key:

sudo cp ~/.ssh/ ~root/.ssh/

(for the Ed25519 key the file name is ‘’)