Skip to main content

How to Generate SSH Keys in Linux

Asher Anwer avatar
Written by Asher Anwer
Updated over a month ago

Secure Shell (SSH) keys are a fundamental part of securing remote server access in Linux systems. Unlike traditional passwords, SSH keys offer a more secure and convenient way to authenticate users. In this article, we’ll walk you through the simple steps to generate SSH keys in Linux, helping you strengthen your system’s security while streamlining the login process.

  1. Open the terminal on your Linux operating system.

  2. Use the command below to generate SSH keys.

    ssh-keygen -t rsa -b 4096

    It will ask you for the full path to save the SSH keys. If you press Enter, the keys will be generated at the default path shown below. After that, it will prompt you to enter a passphrase. If you want to set one, type it and press Enter. If you prefer to leave it blank, just press Enter without typing anything.

    /home/yourusername/.ssh/id_rsa.pub

  3. You have successfully generated your SSH key pair. The private key remains on your computer, while the public key must be uploaded to the server you want to connect to.

  4. You can use the command below to copy your public key and save it to the server you want to connect to.

    cat /home/yourusername/.ssh/id_rsa.pub



    Congratulations! You've successfully generated SSH keys on your Linux operating system.

    If you have any questions, please don’t hesitate to contact our team via live chat.

    For technical inquiries, please feel free to reach our support team by emailing support@bigscoots.com from your registered email or by submitting a support ticket.

Did this answer your question?