Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Post Provisioning Script

Discussion in 'Security' started by Uneschewed, May 14, 2019.

  1. Uneschewed

    Uneschewed Member

    Joined:
    May 13, 2019
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Missouri
    cPanel Access Level:
    Root Administrator
    Hello,

    I am trying to create a post provisioning script to run after my server runs and everything is installed.

    I have created the following code:

    #!/bin/bash
    ### export PATH ###
    export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
    echo "$PATH"
    /usr/bin/sed -i 's/#\?\(PermitRootLogin\s*\).*$/\1 no/' /etc/ssh/sshd_config
    /usr/bin/sed -i 's/#\?\(PasswordAuthentication\s*\).*$/\1 no/' /etc/ssh/sshd_config
    /usr/bin/sed -i 's/#\?\(PermitEmptyPasswords\s*\).*$/\1 no/' /etc/ssh/sshd_config
    service sshd restart

    I have a very basic setup with Linux. The code does not run though when I try to load it from github at the following address:

    - Removed -

    What type of construct do I require to make the code change the sshd_config to the following parameters: no
     
    #1 Uneschewed, May 14, 2019
    Last edited by a moderator: May 15, 2019
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,325
    Likes Received:
    2,157
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @Uneschewed,

    Can you provide more information about how you are executing this script post-installation? Provide step-by-step instructions if possible so we can more easily reproduce the issue.

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice