Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 16 to 30 of 30
  1. #16
    Member
    Join Date
    Apr 2005
    Posts
    99

    Default

    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?

  2. #17
    Member
    Join Date
    Apr 2005
    Posts
    99

    Default

    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?

  3. #18
    Support Manager cPanelEric's Avatar
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    452
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Howdy,

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

  4. #19
    Member
    Join Date
    Apr 2005
    Posts
    99

    Default

    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?

  5. #20
    Support Manager cPanelEric's Avatar
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    452
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Howdy,

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

    You get insta-copy via scp.

  6. #21
    Member
    Join Date
    Apr 2005
    Posts
    99

    Default

    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.

  7. #22
    Member
    Join Date
    Apr 2005
    Posts
    99

    Default

    Ok that worked

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

  8. #23
    Support Manager cPanelEric's Avatar
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    452
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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!

  9. #24
    Member
    Join Date
    Apr 2005
    Posts
    99

    Default

    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?

  10. #25
    Support Manager cPanelEric's Avatar
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    452
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Howdy,

    If you made a backup user and all the worst they could do is kill your backups.

  11. #26
    Member
    Join Date
    Apr 2005
    Posts
    99

    Default

    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!

  12. #27
    Support Manager cPanelEric's Avatar
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    452
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Not a problem, I preach at the pulpit of backups, backups, backups; it was time for a sermon.

    Thanks!

  13. #28
    Member
    Join Date
    Apr 2005
    Posts
    99

    Default

    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!

  14. #29
    Support Manager cPanelEric's Avatar
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    452
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Howdy,

    You can use the "date" command in the raw to get the time. Use it before and after.

  15. #30
    Member
    Join Date
    Apr 2005
    Posts
    99

    Default

    Thanks Eric, I was getting my 's and `s mixed up :lol:
    Last edited by Brook; 07-16-2009 at 01:37 AM.

Similar Threads & Tags
Similar threads

  1. Cron Jobs
    By tech6 in forum New User Questions
    Replies: 2
    Last Post: 10-11-2010, 12:06 AM
  2. Where are cron jobs?
    By Daerious in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 03-08-2009, 03:47 AM
  3. Cron jobs
    By DigiCrime in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 08-04-2005, 03:47 AM
  4. Cron Jobs
    By TitaniumHosting in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 02-01-2005, 09:47 PM
  5. cPanel cron jobs or cron.daily , cron.hourly , etc.?
    By spaceman in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 01-01-2004, 08:16 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube