SSH – Connect to SSH with RSA certificate

security-iconUsing RSA certificate will increase your account/server security. You can configure SSH server to only accept RSA certificate for your root user. Here is how to use certificates for authentications.

On your local system (laptop/workstation/etc)
First we will create the certificate on your local system.
[sourcecode language=”text”]
john@debian7-dev:~$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/john/.ssh/id_rsa):
/home/john/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/john/.ssh/id_rsa.
Your public key has been saved in /home/john/.ssh/id_rsa.pub.
The key fingerprint is:
df:35:53:7a:63:6c:b6:95:c6:90:4c:ec:54:fd:03:99 john@debian7-dev
The key’s randomart image is:
[/sourcecode]
Now your certificate have been created, and stored in your home folder/.ssh/id_rsa

Now we need to copy/install the certificate on the remote system.

On your local system: (when copying the certificate to the remote account it will ask for your password on the remote system)
[sourcecode language=”text”]
john@debian7-dev:~$ ssh-copy-id john@192.168.1.100
john@192.168.1.100’s password:
Now try logging into the machine, with "ssh ‘john@192.168.1.100’", and check in:

~/.ssh/authorized_keys

to make sure we haven’t added extra keys that you weren’t expecting.
[/sourcecode]
Then you are ready to log on to the remote system as john without using passwords.

Happy sshing!

Related Posts

A compact server with connected Ethernet cables and illuminated network ports in a dark server room.

Fix Debian 13’s 120-Second systemd-networkd Boot Delay

A boot pause close to two minutes can occur when systemd-networkd-wait-online.service cannot satisfy its definition of an online network. The systemd 257 documentation specifies a default timeout…

introduction to openmediavault

Introducing OpenMediaVault: Your Ultimate Guide

Want to create a home server setup without spending a lot? OpenMediaVault is a free NAS solution that makes network attached storage easy. It’s great for saving…

Using rsync for One-Way Sync for backup

If you’re looking to set up a one-way sync between a NAS running Debian and a backup machine also running Debian, rsync is a powerful tool to achieve this….

php8 gd

PHP8 gd Activate after installation

PHP8 GD activate after installation. GD doesn’t get activated by default. Not even a reboot after installation will activate it. So how do we do it? In…

Debian 12: linux-image-6.1.0-10amd64

Troubleshooting dependency issues in Debian 12: Resolving linux-image-6.1.0-10amd64 package dependency problems. If you installed the Debian 12 from the live image the issue is the raspi-firmware. Even…

4 Best Free Nas Software That Is Open Source

Free NAS software or operating systems that are free to use and will turn a computer into a NAS more advanced than the dedicated boxes sold. What…

Leave a Reply