• Arun Kumar

Enable SSH Key Entry on Linux

When you run your servers on cloud, you cannot allow direct password login. Instead, you must add an SSH key to the server and share a copy of SSH key with clients. This will allow only authorized people connect to the servers.


Disable Password Authentication


You must first disable password based login on the server


vi /etc/ssh/sshd_config

change PasswordAuthentication from yes to no


Add SSH Key File


You must add the ssh key file to every linux user that you want to have direct access. For now, we are going to add the SSH key to root user

As root user
============

mkdir .ssh
chmod 700 .ssh
touch .ssh/authorized_keys
chmod 600 .ssh/authorized_keys

vi .ssh/authorized_keys

--> paste the ssh key, save and close

Restart ssh service on the server

systemctl restart sshd.service

Done!


5 views

Recent Posts

See All

Important Linux Commands

This article describes important Linux commands that you must know as a system or database administrator. Check CPU cores in Linux Use one of the below commands to find number of CPUs in Linux includi

Manage Linux Firewall with iptables and firewalld

In this article will be covering details regarding iptables and firewalld which helps in Linux firewall management. We will also be looking at how to enable specific ports (1521 for Oracle) inside ipt

Setup Passwordless Connectivity in Linux

Every time you ssh from one Linux server to another, you need to enter target server user's password. We can also setup password less ssh login between two Linux servers so that you don't have to ente

  • Facebook
  • Twitter
  • YouTube
  • Instagram

© 2020 by DBA Genesis