Created
May 25, 2017 18:24
-
-
Save the-paulus/d06f3a75a9c993a579ea102fe52a1c5d to your computer and use it in GitHub Desktop.
Copies ssh authorized keys to each cPanel user account.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for user in $(cat /etc/domainusers | cut -d: -f 1) | |
do | |
if [ ! -d /home/$user/.ssh ] | |
then | |
mkdir /home/$user/.ssh | |
chown "$user":"$user" /home/$user/.ssh | |
fi | |
cp /root/.ssh/authorized_keys /home/$user/.ssh | |
chown "$user":"$user" /home/$user/.ssh/authorized_keys | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment