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.
- Log in to your Jelastic Cloud dashboard
- Click the Import button in the top menu bar
- Go to the JPS tab
- Copy the following code and paste it into the JPS tab (Up to date source: http://owncloudpmo.demo.jelastic.com/index.php/s/2wNR2vGjE1aui51)
version: 1.5 type: update categories: - apps/dev-tools targetNodes: nodeGroup: - bl - cp - sqldb - nosqldb - build - cache - extra name: Root Access logo: https://blog.jelastic.com/wp-content/uploads/2015/11/cs-scheme1.png homepage: https://docs.jelastic.com/ description: 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.** onUninstall: cmd [${targetNodes.nodeGroup}]: - sed -i -e 's/.*NOPASSWD.*//g' /etc/sudoers.d/sudo user: root onInstall: 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 success: 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}
- Click the Import button
- Choose the environment and node for which root access is necessary
- Click the Install button
- To execute root commands, log in to your application via SSH and launch the "sudo su" command.
sudo su