?
Solved

Copying File to Another Server/Host

Posted on 2008-10-30
5
Medium Priority
?
277 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 111

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 111

Accepted Solution

by:
Ray Paseur earned 2000 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
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 …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

777 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