Categories: TutorialsUbuntu

How to Remove SSL Certificate & SSH Passphrase in Linux

SSL certificates secure data transmission to and from websites and applications by encrypting all data. While creating SSL certificates, administrators often use an additional passphrase to add extra level of security. But using passphrase can hinder automated reading of certificates in most cases unless your site has been programmed to automatically supply passphrases. So often website administrators need to remove SSL certificate and SSH passphrase. In this article, we will learn how to do this.

How to Remove SSL Certificate & SSH Passphrase in Linux

We will learn how to remove passphrase from SSL certificate and SSH passphrase separately. SSH keys are used to encrypt/decrypt SSL keys. They both can have same or different passphrases but require different tools and commands for passphrase removal.

Remove
Sponsored
Passphrase from SSL certificate

Let us say you have an SSL certificate private.pem. You can view its contents using any document reader or editor.

$ cat private.pem

Whenever any application or server tries to read the certificate it will be prompted to enter passphrase.

$ openssl rsa -in private.pem -outform PEM -pubout -out public.pem
Enter pass phrase for private.pem:

You can easily remove the passphrase by copying the private key to a new file, using openssl tool.

$ openssl rsa -in private.pem -out private_new.pem 
$ cat private_new.pem 

Now when any application tries to access the new key file, it will not be asked to enter passphrase.

Remove Passphrase from SSH Private Key

Generally, when we generate an SSH key pair (public+private) we are asked to enter a passphrase. If we leave it empty and hit enter, then no passphrase is set.

On the other hand, if you try to use a key that has a pass phrase, as shown below, the SSH client will ask for the pass phrase before proceeding further.

Sponsored
$ ssh -i .ssh/user user@54.43.32.21
Enter password:

To remove the pass phrase, you can use ssh-keygen command with -p option which prompts you to enter existing pass phrase and use -f option to specify the SSH key file. Replace .ssh/user with file path of your SSH key.

$ ssh-keygen -p -f .ssh/user

You will be asked for old password and then the new password. Enter the old password, and leave the new password empty.

Now when you try accessing SSH key, you will not be asked for passphrase.

In this article, we have learnt how to remove passphrase from SSL certificates as well as SSH keys. You need to use openssl to remove passphrase from SSL certificates and ssh-keygen to remove passphrase from SSH keys. Both these tools are available by default in most Linux distributions.

Also read:

How to Capture Linux Signal in Python
How to Send Signal from Python
How to Clear Canvas for Redrawing in JavaScript
How to Use Decimal Step Value for Range in Python
How to Get Browser Viewport Dimension in JS

The post How to Remove SSL Certificate & SSH Passphrase in Linux appeared first on Fedingo.

Ubuntu Server Admin

Recent Posts

Building RAG with enterprise open source AI infrastructure

One of the most critical gaps in traditional Large Language Models (LLMs) is that they…

14 hours ago

Life at Canonical: Victoria Antipova’s perspective as a new joiner in Product Marketing

Canonical is continuously hiring new talent. Being a remote- first company, Canonical’s new joiners receive…

2 days ago

What is patching automation?

What is patching automation? With increasing numbers of vulnerabilities, there is a growing risk of…

3 days ago

A beginner’s tutorial for your first Machine Learning project using Charmed Kubeflow

Wouldn’t it be wonderful to wake up one day with a desire to explore AI…

4 days ago

Ubuntu brings comprehensive support to Azure Cobalt 100 VMs

Ubuntu and Ubuntu Pro supports Microsoft’s Azure Cobalt 100 Virtual Machines (VMs), powered by their…

4 days ago

Ubuntu Weekly Newsletter Issue 870

Welcome to the Ubuntu Weekly Newsletter, Issue 870 for the week of December 8 –…

4 days ago