Linux/Unix Open SSH Login Without Password Key Exchange including Debian, Redhat, Fedora, Ubuntu, BSD etc..

In those 4 simple commands you can setup mutual key exchange between two sshservers by using a single login shell session and single window.

*Just change the IP address examples of (10.10.0.2) to the target of your mutual key exchange.  It doesn't matter if the server is on a LAN or WAN (well unless the server is behind a firewall and you cannot SSH into it).

Code:
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub|ssh 10.10.0.2 tee -a ~/.ssh/authorized_keys

ssh 10.10.0.2 ssh-keygen -t rsa
ssh 10.10.0.2 cat ~/.ssh/id_rsa.pub |tee -a ~/.ssh/authorized_keys


  • *tee simply just takes stdinput and redirects it to where ever you say.
  • *on some systems you'll need to chmod 600 ~/.ssh/authorized_keys


If you want to do it the hard way, on both servers you can just run this command:

ssh-keygen -t rsa

Just keep hitting enter, and then copy and paste the contents of:

~/.ssh/id_rsa.pub into the other servers "~/.ssh/authorized_keys" file.

Be careful not to add any extra spaces or line breaks when copying it or it won't work.

 

 

 


Tags:

linux, unix, ssh, login, password, debian, redhat, fedora, ubuntu, bsd, etc, commands, sshservers, shell, ip, examples, doesn, server, lan, wan, firewall, keygen, rsa, id_rsa, pub, tee, authorized_keys, stdinput, redirects, ll, chmod, servers, contents, quot, spaces, copying,

Latest Articles

  • Convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/413. convert-im6.q16: no images defined `pts-time.jpg' @ error/convert.c/ConvertImageCommand/3258. solution ImageMagick P
  • Apache PHP sending expires header solution cannot use cache with CDN
  • How to install virt-manager in Mint 22/Ubuntu 22
  • Infiniband Guide
  • python mysql install error: /bin/sh: 1: mysql_config: not found /bin/sh: 1: mariadb_config: not found /bin/sh: 1: mysql_config: not found mysql_config --version
  • FreePBX 17 How To Add a Trunk
  • Docker Container Onboot Policy - How to make sure a container is always running
  • FreePBX 17 How To Add Phones / Extensions and Register
  • Warning: The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes. solution
  • Cisco How To Use a Third Party SIP Phone (eg. Avaya, 3CX)
  • Cisco Unified Communication Manager (CUCM) - How To Add Phones
  • pptp / pptpd not working in DD-WRT iptables / router
  • systemd-journald high memory usage solution
  • How to Install FreePBX 17 in Linux Debian Ubuntu Mint Guide
  • How To Install Cisco's CUCM (Cisco Unified Communication Manager) 12 Guide
  • Linux Ubuntu Redhat How To Extract Images from PDF
  • Linux and Windows Dual Boot Issue NIC Won't work After Booting Windows
  • Cisco CME How To Enable ACD hunt groups
  • How to install gns3 on Linux Ubuntu Mint
  • How to convert audio for Asterisk .wav format