i) Linux Account Option:
You can directly connect to the Linux machine using the username and password of the specified user account.
ii) Linux Private Key Option:
You can connect to the Linux machine using the Identity/Pubkey authentication method. If you have already generated a public-private key pair, provide the username, private key, and passphrase (if applicable) to save the Linux credentials. Alternatively, follow the steps below to generate the public-private key pair.
Step 1: Generate a pair of keys - a public key and a private key using the following command:
ssh-keygen -t rsa
Step 2: Specify the location and filename in the format .ppk or .pem to save the key. For example, keys can be generated in the .ppk format:
Example: /home/key.ppk
Step 3: Enter a passphrase or leave it empty. The private key can be protected with a passphrase.
Step 4: The private key (.ppk) and public key (.pub) will be saved to the specified location and file.
Example:
Your identification has been saved in /home/key.ppk
Your public key has been saved in /home/key.ppk.pub
Step 5: Change the file permissions of the private and public keys using the following command:
chmod 755 <private key filename>
chmod 755 <public key filename>
Step 6: On the target Linux machine, the public key needs to be kept in a special authorized_keys file containing a list of public keys using the following command:
ssh-copy-id -i <public key filename> <username>@<Host IP Address>
Step 7: Copy the Private Key file to the backup server using any FTP tools. You should now have the Public key on the Linux machine and the Private key on the backup server.