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.

/etc/chkserv.d/ftpd overwritten?

Discussion in 'General Discussion' started by kpmedia, May 23, 2016.

  1. kpmedia

    kpmedia Well-Known Member

    Joined:
    Feb 13, 2011
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    USA, Europe
    cPanel Access Level:
    Root Administrator
    I use a different FTP port. Default 21 is unsafe.

    /etc/chkserv.d/ftpd reverts on cPanel update.

    A cPanel staff wrote this back in 2010: "You can create a script with the filename /scripts/postupcp to copy your custom version of the file back to /etc/chkserv.d/ftpd after each cPanel update."

    I can't do that. I don't know how. What are the exact steps to do this?

    It's a common request on these boards, and has never been answered.
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I think your question was answered here:
    /etc/chkserv.d/ftpd suddenly overwritten?


    Why is that?
     
  3. kpmedia

    kpmedia Well-Known Member

    Joined:
    Feb 13, 2011
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    USA, Europe
    cPanel Access Level:
    Root Administrator
    It wasn't answered.

    This was a half answer: "You can create a script with the filename /scripts/postupcp to copy your custom version of the file back to /etc/chkserv.d/ftpd after each cPanel update."

    I can't find that thread anymore, but that was the last reply.

    I'm guessing postupcp changes things back that cPanel overwrites. So I'd think that "service[ftpd]=21,QUIT," (start of file) could be replaced with "service[ftpd]=123456,QUIT," instead. Simple replacement, but requiring not-simple syntax, commands, and use of the postupcp file. So how it that done?

    Why not 21? Because 21 is brute forced to hell and back. Lots of of nasty stuff uses it as well. Changing the port removes that problem 99%+. Only generic shared hosts and novices admins use 21.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  5. kpmedia

    kpmedia Well-Known Member

    Joined:
    Feb 13, 2011
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    USA, Europe
    cPanel Access Level:
    Root Administrator
    Yes, that's it. But it was never expanded upon. That's what this thread is for.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    No native support exists for Chkservd to monitor Pure-FTPd on an alternate port. I suggest opening a feature request for this via:

    Submit A Feature Request

    Also, using the /scripts/postupcp file is no longer advised. Instead, please ensure you use standardized hooks:

    Guide to Standardized Hooks
    Guide to Standardized Hooks - System Functions - upcp

    You can register a hook using the following command after creating your custom script:

    Code:
    /usr/local/cpanel/bin/manage_hooks add script /path/to/postupcpscript.sh --manual --category System --event upcp --stage post
    Then, simply ensure /path/to/postupcpscript.sh uses 0755 permissions and contains the code necessary to to update the /etc/chkserv.d/ftpd file. EX:

    Code:
    #!/bin/bash
    replace "21" "1234" -- /etc/chkserv.d/ftpd
    Thank you.
     
Loading...

Share This Page