ssh remote login without password linux ssh-keygen copy-id

How to SSH remote login without username password on Linux Servers Client using ssh-keygen-copy-id commands on various flavor of Linux OS. 

SSH stands for Secure Shell protocol, is a software program in various flavor of linux OS,

SSH is a software package that enables secure remote login system for administration and file transfers over insecure LAN and WAN networks. It is used in nearly every data center and in every large network enterprise organization.

SSH Protocol :-

The SSH is a protocol which uses encryption method to secure the connection between a client and a server. All user authentication, commands, output, and file transfers are encrypted to protect against attacks in the network.

The default port for SSH client connections is 22; to change this default, enter a port number between 1024 and 32,767.

The Secure Shell protocol was originally developed by Tatu Ylonen in 1995 in response to a hacking incident in the Finnish university network. there was password sniffer had been installed on a server connected directly to the network backbone, and when it was discovered, it had thousands of usernames and passwords in its database.

That incident triggered Ylonen to study cryptography and develop a solution he could use himself for remote login over the Internet safely. His friends proposed additional features, and three months later, in July 1995, Ylonen published the first version as open source. It became OpenSSH. Later he took the protocol for standardization at the IETF and designed the SSH File Transfer Protocol (SFTP). He founded SSH Communications Security Corp in 1995 to provide commercial support for the protocol.

Ylonen still works on topics related to Secure Shell, particularly around key management, as well as broader cybersecurity topics.

The SSH protocol is apart of Layer 7: The Application Layer. SSH, is an OSI model application layer protocol It provides strong encryption, cryptographic host authentication, and integrity protection.

Now the SSH protocol is being used for managing more than half of world’s web servers and almost every Unix or Linux based servers and clients, on-premise and in the cloud.

Information security specialists and system administrators use it to configure, manage, maintain, and operate most firewalls, routers, switches, and servers in the millions of mission-critical networks and environments of our digital world. It is also embedded inside many file transfer and systems management solutions.

The new protocol replaced several legacy tools and protocols, including telnet, ftp, FTP, FTFS, rlogin, rsh, and rcp.

How to login SSH with password ?

Some of the remote administration task required automatic login on several servers and clients machine, so to make your password less login we can follow few simple steps to allow “ssh login without password on Linux using ssh-keygen-copy-id command. 

It required  ssh-key pairs, these create ‘trusted networks’ that allow for password-less authentication.

[root@techitadmin]# ssh-keygen -t rsa -b 2048

this commadn will generating public/private rsa key pair.

Enter file in which to save the key (/root/.ssh/id_rsa): # Hit Enter

Enter passphrase (empty for no passphrase): # Hit Enter

Enter same passphrase again: # Hit Enter

Your identification has been saved in /root/.ssh/id_rsa.

Your public key has been saved in /root/.ssh/

Now copy your public key to your remote server (test-server):

now run this command 

#ssh-copy-id root@


cat ~/.ssh/ | ssh user2@server2 “mkdir -p ~/.ssh \

    && cat >>  ~/.ssh/authorized_keys”

Now when you run the scp or any ssh command it will never ask for your password and login automatically. 

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *