How to copy/upload file from local to remote server?
Jump to navigation
Jump to search
Here we are going to copy the file from our local system to nagio’s then from nagio’s to client server
First we have to search for existing key available on nagio’s inside /home/.ssh
If the id_rsa file (key file name) is not available we have to generate the new key file
Generate key under home/ubuntu/.ssh
ssh-keygen cat id_rsa
Copy the contents of key file(/home/.ssh/id_rsa.pub)
Login to the client server (here EC2)
Root -> .ssh/ →authorised_keys
Paste the content of the key file inside the authorised _key file
Use scp command in our nagios to copy the file from local to nagio’s
Login to nagio’s server
Use scp command to copy file from nagio’s to client server
Then delete the key which we copied under the authorised key without fail in the client server.
scp portno filename username@ip:
scp filename password@ip: