#16 (permalink)  
Old 07-14-2009, 12:31 AM
Registered User
 
Join Date: Apr 2005
Posts: 81
Brook is on a distinguished road
Sorry Eirc, I'm stuck on the SSH/SCP

I thought as I am going to use a hosting company for the back-up server I'll use cpanel to generate the keys (as they're bound to be using cpanel). I followed this: Tutorial to use SSH keys instead of password - Web Hosting Talk

And am able to connect to the host server (currently my second server) via: root@localhost ~]# ssh -i /path-to-file/file.key root@server.ip.address

But I can't seem to use that to do a back up with the SCP command in your last post: scp /path/to/filename username@HostnameOrIP:/path/to/backup/dir

Do I need to use a different command? Where am I going wrong?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old 07-14-2009, 08:01 AM
Registered User
 
Join Date: Apr 2005
Posts: 81
Brook is on a distinguished road
Still stuck on this, but I've played around with it more and seem to have worked out this much (please correct me if I'm wrong).

I create a SSH key on the machine I want to connect _from_

Then I import the public key from that machine to the machine I want to connect _to_

Well I managed that on my Mac, being able to connect to my server. It simply asked me for the passphrase then connected, and now it just simply connects without asking for the passphrase

But I tried the same on the server (to server) - created a key on the machine I want to connect from (the host) and then imported the public key into the account of the machine I want to connect to (back-up destination server). So then I su to the host machines account (for that key) and try to ssh account_name@ip.address but then it asks for a password.

I've looked in authorised keys for the destination servers account and my imported key is in there (only thing worth noting is it ends in account_name@root.server.hostname instead of account_name@domain).

Any ideas what I'm doing wrong?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18 (permalink)  
Old 07-14-2009, 09:21 AM
cPanelEricE's Avatar
cPanel Staff (Administrator)
 
Join Date: Nov 2007
Location: Texas
Posts: 170
cPanelEricE is on a distinguished road
Howdy,

In this case, you really need to make your ssh key outside of cPanel/WSO. Give it a try via that method.
__________________
--Eric(E)

Using Enkompass compared to cPanel is like going to a MacDonald’s in France, sure they’ve got the same things we have over here, but it’s a little different.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19 (permalink)  
Old 07-14-2009, 09:26 AM
Registered User
 
Join Date: Apr 2005
Posts: 81
Brook is on a distinguished road
Hi Eric, I've just tried it with:

scp -i /path-to-file/file.key /path/to/filename username@HostnameOrIP:/path/to/backup/dir

and it asks for a passphrase then copies the file. I guess I need some way to cache the passphrase so it doesn't ask for it?

If I do it the other way I may not be able to use a normal host as they may not give me ssh access :-/

Are there any other methods we can use apart from SCP?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #20 (permalink)  
Old 07-14-2009, 09:27 AM
cPanelEricE's Avatar
cPanel Staff (Administrator)
 
Join Date: Nov 2007
Location: Texas
Posts: 170
cPanelEricE is on a distinguished road
Howdy,

If you make the key outside of cPanel you can create it without a pass phrase

You get insta-copy via scp.
__________________
--Eric(E)

Using Enkompass compared to cPanel is like going to a MacDonald’s in France, sure they’ve got the same things we have over here, but it’s a little different.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #21 (permalink)  
Old 07-14-2009, 09:31 AM
Registered User
 
Join Date: Apr 2005
Posts: 81
Brook is on a distinguished road
Is there anyway to make the key in cpanel without a passphrase? Might be handy if I use a normal host

(What are the security implications of not having a passphrase?)
(Also does it matter where the key is created? So I could create a key on my PC and upload it to the host account in question? )

Last edited by Brook; 07-14-2009 at 09:34 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #22 (permalink)  
Old 07-14-2009, 09:40 AM
Registered User
 
Join Date: Apr 2005
Posts: 81
Brook is on a distinguished road
Ok that worked

Only thing is, how much of a security risk is it not having a passphrase?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #23 (permalink)  
Old 07-14-2009, 09:49 AM
cPanelEricE's Avatar
cPanel Staff (Administrator)
 
Join Date: Nov 2007
Location: Texas
Posts: 170
cPanelEricE is on a distinguished road
Howdy,

cPanel's won't let you do it that for security issues. If you have that problem on another host, make your key at home on your mac and ftp it over.

Thanks!
__________________
--Eric(E)

Using Enkompass compared to cPanel is like going to a MacDonald’s in France, sure they’ve got the same things we have over here, but it’s a little different.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #24 (permalink)  
Old 07-14-2009, 09:49 AM
Registered User
 
Join Date: Apr 2005
Posts: 81
Brook is on a distinguished road
I got another post in before you replied

I got it to work - yay!

Only thing is, how much of a security risk is not having a passphrase?

I guess they would need to hack into my server then find the key _and_ know the ip of the private key. So it's still pretty secure right?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #25 (permalink)  
Old 07-14-2009, 10:00 AM
cPanelEricE's Avatar
cPanel Staff (Administrator)
 
Join Date: Nov 2007
Location: Texas
Posts: 170
cPanelEricE is on a distinguished road
Howdy,

If you made a backup user and all the worst they could do is kill your backups.
__________________
--Eric(E)

Using Enkompass compared to cPanel is like going to a MacDonald’s in France, sure they’ve got the same things we have over here, but it’s a little different.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #26 (permalink)  
Old 07-14-2009, 10:02 AM
Registered User
 
Join Date: Apr 2005
Posts: 81
Brook is on a distinguished road
That's ok then

All I gotta do now is add it all to the script and cron and see how it works

Thanks again for all your help... you've been a real gent I'll let you know how it goes!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #27 (permalink)  
Old 07-14-2009, 10:11 AM
cPanelEricE's Avatar
cPanel Staff (Administrator)
 
Join Date: Nov 2007
Location: Texas
Posts: 170
cPanelEricE is on a distinguished road
Not a problem, I preach at the pulpit of backups, backups, backups; it was time for a sermon.

Thanks!
__________________
--Eric(E)

Using Enkompass compared to cPanel is like going to a MacDonald’s in France, sure they’ve got the same things we have over here, but it’s a little different.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #28 (permalink)  
Old 07-14-2009, 06:51 PM
Registered User
 
Join Date: Apr 2005
Posts: 81
Brook is on a distinguished road
It works! Thanks Eric

Just a quickie, is there anyway to echo the time? That way I'll echo before and after the mysqldump - which will let me see in the cron report how long it is taking and I can adjust my message (shown to site visitors) accordingly.

Thanks again for all your help - I've tried to give you more rep points but it won'y let me - says I need to spread it around first!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #29 (permalink)  
Old 07-15-2009, 02:13 PM
cPanelEricE's Avatar
cPanel Staff (Administrator)
 
Join Date: Nov 2007
Location: Texas
Posts: 170
cPanelEricE is on a distinguished road
Howdy,

You can use the "date" command in the raw to get the time. Use it before and after.
__________________
--Eric(E)

Using Enkompass compared to cPanel is like going to a MacDonald’s in France, sure they’ve got the same things we have over here, but it’s a little different.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #30 (permalink)  
Old 07-15-2009, 08:41 PM
Registered User
 
Join Date: Apr 2005
Posts: 81
Brook is on a distinguished road
Thanks Eric, I was getting my 's and `s mixed up :lol:

Last edited by Brook; 07-16-2009 at 01:37 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
cron jobs urgido Discusión en Español 6 05-10-2008 06:20 PM
Cron Jobs 4402734 cPanel and WHM Discussions 1 10-20-2005 02:34 PM
Cron jobs DigiCrime cPanel and WHM Discussions 2 08-04-2005 03:47 AM
Cron Jobs mbs5 cPanel Newbies 1 06-28-2005 01:35 PM
cPanel cron jobs or cron.daily , cron.hourly , etc.? spaceman cPanel and WHM Discussions 6 01-01-2004 08:16 PM


All times are GMT -5. The time now is 06:17 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc