Skip to Content

How to add ssh public key for passwordless authentication in ssh

Enabling passwordless SSH Login from gateway to remote servers using public keys


Overview: This article offers a step-by-step guide to configure passwordless SSH authentication for gateway users accessing the Ezeelogin backend shell (ezsh). It details the process of adding SSH public keys to the gateway server, allowing users to log in seamlessly without being prompted for passwords.


SSH Gateway users can add their public keys for passwordless authentication to log in from the ezsh shell ( ezeelogin backend shell). Press the F2 key in the ezeelogin shell to enter the public keys for SSH-authorized keys-based authentication so that the user's password will not be prompted again. Follow the steps below:


Step 1: Log into the Ezeelogin backend interface (known as the ezsh shell). Start by entering your password. If two-factor authentication (2FA) is enabled, you’ll need to complete that step as well. This will give you access to the necessary configuration options.

Step 2: Once you're in the ezsh shell, press "F2" or "#" on your keyboard. This will take you to the section where you can manage SSH public keys.

Step 3: In this section, you’ll find a prompt where you can add SSH public keys. Paste the SSH public key you want to use into the provided space and press Enter to confirm and save it. This key will now be used for authentication.

If you need to add multiple SSH public keys, you can also do so by editing the file located at /home/tom/.ssh/authorized_keys. Simply append the new keys to this file, ensuring each key is on a new line.

Note:

The public key you are adding to the ezeelogin master node will not be synced/copied to the slave/secondary node.

Copy the public key from the master node to the slave node and vice versa.

As an alternative way,

Step 1: Create an authorized_keys file and paste your public key inside it.

Step 2: After transferring the public keys into the authorized_keys file, Follow the below steps;-

root@gateway:~# sftp tom@gateway_ip

Step 3: Enter the password of the gateway user when prompted.

sftp> cd .ssh/
sftp> put authorized_keys


Related Articles:

Different types of SSH authentication keys

Set SSH Key Expiry for the gateway users

Enable/Disable password or key-based authentication

How can I add more than one public key to ezeelogin users?