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.

 

 

 

Latest Articles

  • Centos 7 - Convert Minimal to Graphical GUI GNOME or KDE Desktop
  • AMD Set Fan Speed and Other Powerplay Memory/CPU Timings with a Linux script
  • Ethereum Mining Claymore Nanopool Error
  • genisoimage errors with long filenames and deep directory structures
  • Linux Kernel USB Export Errors
  • How to download gajim 0.16.9 XMPP/Jabber client so you can use OMEMO encryption
  • HP DL385 G7 Linux BIOS Update Flash
  • hwloc-nox set CPU affinity in Linux
  • Firefox An error occurred during a connection to some-ip-or-domain. SSL peer reports incorrect Message Authentication Code. Error code: SSL_ERROR_BAD_MAC_ALERT Solution
  • Proxmox understanding the directory structure and why an NFS datastore appears to be missing files/isos
  • pandoc convert markdown to html
  • Proxmox error uploading an iso solution
  • Cannot install moodle
  • MySQL change for Antelope format to Barracuda error solution
  • vmkping -I vmk1 10.0.2.69 PING 10.0.2.69 (10.0.2.69): 56 data bytes sendto() failed (Host is down)
  • gvfs mount in /run/user cannot be accessed or displayed wrong permissions
  • VMWare vSphere 6.7 Errors Solution 503 Service Unavailable (Failed to connect to endpoint:
  • How To Enable Nested KVM so guests can virtualize with hardware extensions
  • vi error solution E166: Can't open linked file for writing
  • Supermicro IPMI / KVM / BMC Remote Console Screen Resizing Issue - Window Cut Off Solution