6/17/2023 0 Comments Acrosync between two remote![]() Ssh lets you issue a command at the remote machine without giving you a shell, if you have the above setup you can do the following: ssh 'hostname id' This makes it so you can ssh from a machine you have sshed to, to another one that has your public key in authorized_keys and you won't be prompted for a password, or passphrase, as it will handle the communication back to the keychain at your source machine. Set AllowAgentForwarding yes in /etc/ssh/sshd_config on the remote hosts. Now, while in this shell if ssh is called it will pull your private key from the keyring instead of prompting you for the passphrase. This first runs bash with a "keyring" attached to it, then adds your key to the keyring. You can avoid having to type your passphrase over and over by using ssh-agent bash, followed by ssh-add. On your remote machines you will want to append your id_rsa.pub to this file.ĭuring ssh attempts you will now be prompted for your passphrase to your private key instead of your password. This file is a list of public keys that are authorized to be used for authentication. authorized_keysĭuring login ssh looks for a file at $HOME/.ssh/authorized_keys. This is where the passphrase comes in, it makes it so if someone gets your private key they still need to know the passphrase. ![]() If someone gets a hold of your private key then they can authenticate to any account/machine that is set up to accept your private key. The public key (id_rsa.pub) can be shared with anyone without fear of your account being compromised by them. it will also generate two files $HOME/.ssh/id_rsa (don't share this), and $HOME/.ssh/id_rsa.pub. You can generate an ssh key pair by using ssh-keygen, it will prompt you for a passphrase, you will want to enter something secure here. Describe ssh-agent forwarding, and how to use them with rsync to sync two remote machines. In this answer I will cover how to setup an ssh public/private key pair. Ssh can authenticate with a password, or with a public/private keypair. You can use ssh, with ssh public/private keys to do this securely with rsync.
0 Comments
Leave a Reply. |