Solved

Copying File to Another Server/Host

Posted on 2008-10-30
5
270 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
  • 3
  • 2
5 Comments
 
LVL 108

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 108

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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

912 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now