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.

Public key when creating a new account

Discussion in 'General Discussion' started by Tom Risager, Apr 5, 2013.

  1. Tom Risager

    Tom Risager Well-Known Member

    Joined:
    Jul 10, 2012
    Messages:
    107
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Copenhagen, Denmark, Denmark
    cPanel Access Level:
    Root Administrator
    We use cPanel on a development server where we create new accounts on a daily basis. We use the same public/private key pair for SSH logins to most accounts on this server (the keys are changed periodically).

    Is there some way that we can automate the authorization of the current public key when we create a new account, so we can skip the extra step of opening cPanel to perform the import and authorization manually?
     
  2. ThinIce

    ThinIce Well-Known Member

    Joined:
    Apr 27, 2006
    Messages:
    346
    Likes Received:
    7
    Trophy Points:
    18
    Location:
    Disillusioned in England
    cPanel Access Level:
    Root Administrator
  3. Tom Risager

    Tom Risager Well-Known Member

    Joined:
    Jul 10, 2012
    Messages:
    107
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Copenhagen, Denmark, Denmark
    cPanel Access Level:
    Root Administrator
    Thanks, looks like some of those API functions can be used.
     
  4. Tom Risager

    Tom Risager Well-Known Member

    Joined:
    Jul 10, 2012
    Messages:
    107
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Copenhagen, Denmark, Denmark
    cPanel Access Level:
    Root Administrator
    We found a very simple solution that does not require learning to use cPanels APIs: cPanel has a skeleton directory structure that is used when creating a new account (/root/cpanel3-skel). We simply placed our public key in /root/cpanel3-skel/.ssh/authorized_keys.
     
Loading...

Share This Page