Creating a non-root user to log into Web Service's Azure Web SSH Panel

Nick Holzthum 1 Reputation point
2021-07-29T22:54:07.977+00:00

I am trying to install a CMS on a PHP-Linux App Service environment as a non-root user but when I go to the web SSH panel, it automatically logs me in as the root user. How do I create a non-root user for the App Service Environment that I can automatically be logged in as when I open the Azure Web SSH Panel?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 28,036 Reputation points Microsoft Employee Moderator
    2021-07-30T19:54:19.403+00:00

    @Nick Holzthum ,

    Firstly, you don't have to worry about using root user for SSH for App Service.

    App Service uses port 2222 for SSH into your app's container, but that doesn't mean that port 2222 is exposed over the Internet. No matter how you use SSH in your app, all SSH traffic is handled through an endpoint on port 443. As a side note, if you're not using SSH, you don't have to worry about closing port 2222 because it's not exposed to the Internet.
    (Port 2222 of the container is accessible only within the bridge network of a private virtual network and is not accessible to an attacker on the internet.)

    In order to access the SSH port, as one must first login to the Kudu container via HTTPS/it's not exposed to the Internet.

    As a best practice:

    You shouldn't install components using SSH because they won't persist. “In general it's not recommended to install stuff over SSH since App Service instances are ephemeral so any time there is a VM rotation your app would be broken in that new instance requiring you to SSH and install the component again.”

    If you want to install a particular component, make sure that you do it in a Dockerfile so that the component is included in your Docker image. See this documentation for full information on how to do that.

    Additionally:

    As for as the root folder PHP, the default PHP image for App Service uses Apache, and it doesn't let you customize the site root for your app.
    To work around this limitation, add an .htaccess file to your repository root:

    Configure a PHP app for Azure App Service | Change site root:

    Please see this for more details - Things You Should Know: Web Apps and Linux

    Kindly let us know if this helps or you need any further help/and share more details about your requirement.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.