Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Manage Root access on Jelastic Cloud (to execute commands on any container)
This guide details Jelastic Cloud root access to launch commands on any of your containers.
Indeed, some Jelastic Cloud containers do not have root access by default. It is possible to open this access on the containers of your choice by installing an add-on.
As a host, Infomaniak is only an intermediary and we cannot provide additional support on this subject. If necessary, you can contact one of our partners or fill out a call for tenders free of charge.
Also Read: Install Packages Install Packages Without Root Access
Allow root access
- connect to the dashboard of your Jelastic Cloud
- click the Import button from the menu bar at the top
- go to the JPS tab
- copy the following code and paste it in the JPS tab
type: update
name: Root Access
targetNodes:
nodeGroup: '*'
onInstall:
- cmd[${targetNodes.nodeGroup}]: |-
TARGET_UID=$(id -u jelastic 2>/dev/null) || TARGET_UID="700"
getent passwd "${TARGET_UID}" &>/dev/null && TARGET_USER=$(getent passwd "${TARGET_UID}" | cut -d: -f1) || TARGET_USER="jelastic"
sed -i "\$a${TARGET_USER}\ALL=NOPASSWD\:\ALL" /etc/sudoers; echo ${TARGET_USER}
user: root
- setGlobals:
sudo_user: ${response.out}
onUninstall:
cmd[${targetNodes.nodeGroup}]: |-
sed -i "/${globals.sudo_user}\ALL=NOPASSWD\: \ALL /d" /etc/sudoers
user:root
- click the Import button
- choose the environment and node on which root access is needed
- click on the Install button
To then run commands as root, log in via SSH to your application and run the commandsudo su
Link to this FAQ: