Kennisbank
1.000 veelgestelde vragen, 500 tutorials en uitlegvideo's. Hier vind je alleen maar oplossingen!
Manage Root access on Jelastic Cloud (to execute commands on any container)
This guide details how to access the root of Jelastic Cloud to execute commands on any of your containers.
Introduction
- Some Jelastic Cloud containers do not have root access by default.
- It is possible to enable this access on the containers of your choice by installing an add-on.
- You should also consult this other guide if you are looking for information on installing packages without root access.
Allow root access
To do this:
- Log in to the dashboard of your Jelastic Cloud.
- Click on the Import button in the top menu bar.
- Go to the JPS tab.
Copy the following code and paste it into 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 the node on which root access is required.
- Click the Install button.
To then execute commands as root, connect to your application via SSH and enter the command sudo su.
Link naar deze veelgestelde vragen: https://faq.infomaniak.com/2346
Is deze veelgestelde vragenlijst nuttig geweest?