How to copy/upload file from local to remote server?

From PheonixSolutions
Jump to navigation Jump to search
  1. Here we are going to copy the file from our local system to nagio’s then from nagio’s to client server

  2. First we have to search for existing key available on nagio’s inside /home/.ssh

  3. 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
  1. Copy the contents of key file(/home/.ssh/id_rsa.pub)

  2. Login to the client server (here EC2)

Root -> .ssh/ →authorised_keys
  1. Paste the content of the key file inside the authorised _key file

  2. Use scp command in our nagios to copy the file from local to nagio’s

  3.   scp portno filename username@ip:
    
  4. Login to nagio’s server

  5. Use scp command to copy file from nagio’s to client server

  6.   scp filename password@ip:
    
  7. Then delete the key which we copied under the authorised key without fail in the client server.