Root access to any container

Authorising root access to a Jelastic container

Some Jelastic containers do not have root access by default. It is possible to enable this access to containers of your choice by installing an add-on.

  1. Log in to your Jelastic Cloud dashboard
  2. Click the Import button in the top menu bar
  3. Go to the JPS tab
  4. Copy the following code and paste it into the JPS tab (Up to date source:
    version: 1.5
    type: update
    - apps/dev-tools
      - bl
      - cp  
      - sqldb
      - nosqldb
      - build
      - cache
      - extra
    name: Root Access
      short: Enable a full root access to your container
      text: The Root Access add-on reconfigures the container to provide you with a full root access. Be aware that such connection is extremely powerful and, if used inappropriately, may lead to your container / application failure. **Proceed on your own risk and only in case you know exactly what to do.**
      cmd [${targetNodes.nodeGroup}]:
      - sed -i -e 's/.*NOPASSWD.*//g' /etc/sudoers.d/sudo
      user: root
      cmd [${targetNodes.nodeGroup}]:
      - 'USER=$(grep -i ''x:''$(cat /etc/passwd | grep jelastic:x | cut -d'':'' -f 3) /etc/passwd | grep -v jelastic:x | cut -d: -f1)'
      - 'touch /etc/sudoers.d/sudo'
      - 'echo "$USER ALL=NOPASSWD: ALL" >> /etc/sudoers.d/sudo'
      - 'echo "jelastic ALL=NOPASSWD: ALL" >> /etc/sudoers.d/sudo'
      user: root
      text: |
        The Root Access add-on was successfully installed. Access your container over SSH and run the **sudo su** command. *Note:*
        Jelastic is not liable for any actions performed or damage caused via root to your container / application.
      email: false
    startPage: ${env.url}
  5. Click the Import button
  6. Choose the environment and node for which root access is necessary
  7. Click the Install button
  8. To execute root commands, log in to your application via SSH and launch the "sudo su" command.
    sudo su​
  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

Installing node.js in Appserver containers

Adding node.js to installed Appserver containers For node.js v14.x: # Using Ubuntu curl -sL...