generate ssh keys on source machine
root@murali:~# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:RV1mZoookCqRSNeHaGYd+Inv+Fvp1/RNIKjfBOn3KHE root@murali
The key’s randomart image is:
+—[RSA 3072]—-+
|oo .*oo .. .* |
|+ .*.= . o ..* |
| .+.o + . = . |
|. .. o . = . . |
| . . S . . . |
| . ..o E . |
| o o. O + o |
| . .o + + o . |
| .o… . |
+—-[SHA256]—–+
root@murali:~#
cat /root/.ssh/id_rsa.pub
Destination machne
nano ./ssh/authorizedkeys
[ Directory ‘./ssh’ does not exist ]
or
nano /root./ssh/authorizedkeys
[ Directory ‘/root./ssh’ does not exist ]
nano /root/.ssh/authorizedkeys
root@instance-1:~/.ssh# ls -a
. .. .authorizedkeys.swp authorized_keys
root@instance-1:~/.ssh#
nano authorized_keys
copied to remote server
ssh root@ip
and exit then
scp /var/www/html/spro.zip root@34.131.128.229:/var/www/html/