Solved

Copying File to Another Server/Host

Posted on 2008-10-30
5
275 Views
Last Modified: 2010-04-21
Ok part xxx? (I forget) of a job I was clueless of before starting.

http://www.experts-exchange.com/Database/MySQL/Q_23746849.html
http://www.experts-exchange.com/Database/MySQL/Q_23834886.html
http://www.experts-exchange.com/Database/MySQL/Q_23850836.html
http://www.experts-exchange.com/Database/MySQL/Q_23854456.html
http://www.experts-exchange.com/Database/MySQL/Q_23855516.html
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_23861816.html


I gave away alot of points recently.

Ok now I need to send a file from one server to another. I have a dump file on my local company server that I need to copy onto the web server, then run it.

I thought maybe I could use ssh/scp but I realize that is not possible because it prompts for a password. Then I found I could use a key to copy it. But I also see that it can be done other ways.

I am very unfamiliar with these commands and not sure which is the best method, or how to write it.

I have PHP available or run commands by Cron Jobs. Or maybe someone can recommend a better way. I'm open to anyway that works.

Thanks.
0
Comment
Question by:SaltyDawg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 22844358
Do you have an account on the other server?  If so, contact the administrator for help with FTP.
0
 
LVL 1

Author Comment

by:SaltyDawg
ID: 22844381
I do have an account, would ftp allow me to do it automatically? Say I wanted to run the script at midnight each day to copy the file to the other server?
0
 
LVL 1

Author Comment

by:SaltyDawg
ID: 22844684
I followed this instruction for creating a public key.

----------------------
ssh-keygen -t rsa


#

In response, you should see:

Generating public/private rsa key pair
Enter file in which to save the key ...


Press Enter to accept this.
#

In response, you should see:

Enter passphrase (empty for no passphrase):


You don't need a passphrase, so press Enter twice.
#

In response, you should see:

Your identification has been saved in ...
Your public key has been saved in ...


Note the name and location of the public key just generated. It always ends in .pub.
#

Copy the public key just generated to all of your remote Linux boxes. You can use scp or FTP or whatever

to make the copy. Assuming you're using root--again, see my warning in step 1--the key must be contained

in the file /root/.ssh/authorized_keys. Or, if you are logging in as a user, for example, clyde, it

would be in /home/clyde/authorized_keys. Notice that the authorized_keys file can contain keys from

other PCs. So, if the file already exists and contains text, you need to append the contents of your

public key file to what already is there.
--------------------------------------------

Your identification has been saved in /home/me/.ssh/id_rsa.
Your public key has been saved in /home/me/.ssh/id_rsa.pub.

but when I attempt to copy it with:
scp id_rsa.pub usr@myhost:ebk

it say no file or directory

Am I doing something wrong
0
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 22844915
Sure - there aer ways to automate FTP.  One way would be a cron job.

Sorry, I can' t follow that public key stuff.  You would probably want a password-protected login anyway if you're using FTP or something like it to transfer stuff into your site.
0
 
LVL 1

Author Closing Comment

by:SaltyDawg
ID: 31511788
tahank
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hyper-convergence systems have taken the IT world by storm and have quickly started to change our point of view of how the data center should and could be architected. In this article, I’ll explain the benefits of employing a hyper-converged system …
Learn about cloud computing and its benefits for small business owners.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question