The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ssh key trouble

Discussion in 'General Discussion' started by noimad1, Jan 21, 2013.

  1. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    I used the manage ssh keys in WHM on my two servers. I setup a key on one server, authroized it, went to the other server and imported it into the public key, then authorized it. I then did vice-versa on the other server.

    Now I'm trying to use Rsync to connect from one to the other with this command:

    rsync -azv -e ssh --delete /home/mysqlbackup/ root@mybackupserver:/home/backuppath


    But it still keeps prompting me for the password.

    Even if I just try "ssh root@myserver.com" from either server it prompts.

    Did I miss something in all this?
     
    #1 noimad1, Jan 21, 2013
    Last edited: Jan 21, 2013
  2. speckados

    speckados Well-Known Member

    Joined:
    May 21, 2003
    Messages:
    291
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Acequias :: Granada :: España
    cPanel Access Level:
    DataCenter Provider
    Twitter:

    Verify this.

    ON SERVER mybackupserver
    cat /root/.ssh/authorized_keys
    mut be a line (one line) with content of
    cat /root/.ssh/id_rsa.pub of ORIGINAL_SERVER
     
  3. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    Turned out it was just the syntax on my rsync. To use rsync with ssh keys it should have looked like this:

    rsync -azv -e 'ssh -l root -i /pathtokeyfile' --delete /home/mysqlbackup/ root@mybackupserver:/home/backuppath

    I didn't know I had to tell it specifically that I wanted to use the root user and which keyfile to use. I guess I thought it would do it by default since I was logged in as root, but made perfect sense after I realized it.

    Thanks cpanel support for helping me out with that one! I really have to give them kudos for helping out with such a trivial item.
     
Loading...

Share This Page