rsa private / publik key erstellen

To generate a private key and public key pair for SSH access on Ubuntu, you can use the OpenSSH utility called ssh-keygen. Here’s a step-by-step guide:

  1. Open a terminal on your Ubuntu machine.
  2. Run the following command to generate the key pair:
ssh-keygen -t rsa -b 4096 -C ""

Replace "" with your own email address or any identifier you prefer.

  1. You will be prompted to specify the file location to save the key pair. Press Enter to accept the default location (/home/your_username/.ssh/id_rsa) or provide a different path.
  2. You will then be prompted to enter a passphrase. A passphrase adds an extra layer of security to your private key, but it’s optional. You can press Enter to leave it empty, but it’s generally recommended to use a passphrase for added security. If you choose to use a passphrase, make sure to remember it, as you will need it whenever you use the private key.
  3. After generating the keys, you will see output similar to:
Your identification has been saved in /home/your_username/.ssh/id_rsa.
Your public key has been saved in /home/your_username/.ssh/
  1. The private key is stored in the file id_rsa, and the public key is stored in These are the files you’ll need for SSH access.
  2. You can now copy the public key ( to the remote SSH server. You can use the ssh-copy-id command to automate this process. Run the following command, replacing username and server_address with the appropriate values:
ssh-copy-id -i ~/.ssh/ username@server_address

This command will prompt you for the password of the remote user account.

  1. Once the public key is copied to the remote server, you should be able to authenticate using your private key without entering a password.

That’s it! You have successfully generated a private key and public key pair and copied the public key to the remote SSH server.

Beitrag veröffentlicht




Wir benutzen Cookies um die Nutzerfreundlichkeit der Webseite zu verbessen. Durch Deinen Besuch stimmst Du dem zu.