Public key when creating a new account

Tom Risager

Well-Known Member
Jul 10, 2012
116
6
18
Copenhagen, 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?
 

Tom Risager

Well-Known Member
Jul 10, 2012
116
6
18
Copenhagen, 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.