EDIT 0 - Nav Links
I first posted to see if there was an interest in this HOW TO and, seeing that there was, posted the HOW TO somewhere further down the page. For ease of navigation, use the following links to jump straight to the meaty bits:
Part 1 of 3 : Introductions and problem definition
Part 2 of 3 : The solution in lot of pieces
Part 3 of 3 : Putting it all together
Preface (an introduction to set the scene)
WHM/cPanel provides a very nice API for 'remotely' accessing certain WHM or cPanel features. In this case 'remotely' means either accessing the features of one server from another or accessing WHM or cPanel features from scripts running as normal users. These can be referred to as 'remote access features'
Used correctly, the remote access features offer you (relatively) unlimited functionality within your own scripts. This can be accomplished by mimicking the functionality of the supplied PHP remote access features so as to get your own custom written scripts to securely execute as root, therefore letting you read from and write to a plethora of system-related files.
Since WHM/cPanel effectively provides a GUI that (very nicely) performs operations on a number of system-related files (a somewhat over-simplification, but roughly right), the ability to do so yourself passes the power or WHM/cPanel to your own scripts. This is very good for integrating powerful features into your own website (your own website can do anything WHM/cPanel does and therefore presents the ultimate branding experience).
Why a HOW TO?
Forum users, particularly those new to WHM/cPanel, often ask the following types of questions:
- how do the remote access features work?
- what can be accomplished through the remote access features?
- why are the remote access features so limited in their functionality?
Often it is not easy to give detailed answers to such questions, either due to a lack of time or due to not wanting to get dragged down into trying to help people fix their own scripts.
Since I've derived my own method for using the remote access features to securely run PHP scripts as root, I thought I'd write a HOW TO on the subject so as to:
- generally answer the above types of questions
- provide an example-based method, built up from first principles, to allow people to expand on the supplied remote access functions in their own way
- reduce the need for people to repeatedly ask the above questions
Is there an interest?
I think people would be interested in knowing how to do this, and I also think that it would be beneficial to pool such experiences, so that the best and most secure methods can be shared and used to a greater good.
However, it will take me a fair amount of time and effort to put what is in my head into a decent HOW TO format suitable for these forums.
For now, I'd just like to find out if anyone is interested in me putting together a HOW TO on the topic. If so, I'll get to it. If not, I won't. Comments would therefore be greatly appreciated!
EDIT 1
The HOW TO is being prepared at the moment. I'll post it as soon as it's ready. Time permitting, that may be today. If not, it may be in a couple of days at most.
EDIT 2
The HOW TO has now been added in three rather long posts. I'll be the first to admit that it's a fair amount to read, but hopefully it covers things in sufficient detail to actually make sense.
I first posted to see if there was an interest in this HOW TO and, seeing that there was, posted the HOW TO somewhere further down the page. For ease of navigation, use the following links to jump straight to the meaty bits:
Part 1 of 3 : Introductions and problem definition
Part 2 of 3 : The solution in lot of pieces
Part 3 of 3 : Putting it all together
Preface (an introduction to set the scene)
WHM/cPanel provides a very nice API for 'remotely' accessing certain WHM or cPanel features. In this case 'remotely' means either accessing the features of one server from another or accessing WHM or cPanel features from scripts running as normal users. These can be referred to as 'remote access features'
Used correctly, the remote access features offer you (relatively) unlimited functionality within your own scripts. This can be accomplished by mimicking the functionality of the supplied PHP remote access features so as to get your own custom written scripts to securely execute as root, therefore letting you read from and write to a plethora of system-related files.
Since WHM/cPanel effectively provides a GUI that (very nicely) performs operations on a number of system-related files (a somewhat over-simplification, but roughly right), the ability to do so yourself passes the power or WHM/cPanel to your own scripts. This is very good for integrating powerful features into your own website (your own website can do anything WHM/cPanel does and therefore presents the ultimate branding experience).
Why a HOW TO?
Forum users, particularly those new to WHM/cPanel, often ask the following types of questions:
- how do the remote access features work?
- what can be accomplished through the remote access features?
- why are the remote access features so limited in their functionality?
Often it is not easy to give detailed answers to such questions, either due to a lack of time or due to not wanting to get dragged down into trying to help people fix their own scripts.
Since I've derived my own method for using the remote access features to securely run PHP scripts as root, I thought I'd write a HOW TO on the subject so as to:
- generally answer the above types of questions
- provide an example-based method, built up from first principles, to allow people to expand on the supplied remote access functions in their own way
- reduce the need for people to repeatedly ask the above questions
Is there an interest?
I think people would be interested in knowing how to do this, and I also think that it would be beneficial to pool such experiences, so that the best and most secure methods can be shared and used to a greater good.
However, it will take me a fair amount of time and effort to put what is in my head into a decent HOW TO format suitable for these forums.
For now, I'd just like to find out if anyone is interested in me putting together a HOW TO on the topic. If so, I'll get to it. If not, I won't. Comments would therefore be greatly appreciated!
EDIT 1
The HOW TO is being prepared at the moment. I'll post it as soon as it's ready. Time permitting, that may be today. If not, it may be in a couple of days at most.
EDIT 2
The HOW TO has now been added in three rather long posts. I'll be the first to admit that it's a fair amount to read, but hopefully it covers things in sufficient detail to actually make sense.
Last edited: