|
|||
|
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? |
|
|||
|
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? |
|
|||
|
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? |
|
||||
|
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. |
|
|||
|
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. |
|
||||
|
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. |
|
|||
|
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? |
|
||||
|
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. |
|
||||
|
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. |
|
|||
|
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! |
|
||||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |