Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Support
  3. CLI in apps: files and directory created got root ownership

CLI in apps: files and directory created got root ownership

Scheduled Pinned Locked Moved Solved Support
webterminal
3 Posts 3 Posters 264 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • imc67I Offline
    imc67I Offline
    imc67
    translator
    wrote on last edited by joseph
    #1

    In apps (at least WP-D) when you create a directory or file in the app-Terminal it gets 'root' as owner. Is this intended?
    I noticed that after restart of the app it has www-data.

    1 Reply Last reply
    1
    • murgeroM Offline
      murgeroM Offline
      murgero
      App Dev
      wrote on last edited by murgero
      #2

      The terminal for most apps (if not all) default to login as "root" so this is by design. Restarting fixes the perms cause the startup script switches them to whatever the app needs (in wordpress's case it's www-data" if you wanna make it like that from the get go:

      Use either: chown www-data:www-data <whatever dir>

      Or: su - www-data then mkdir where ever you need it: mkdir <whatever dir>

      --
      https://urgero.org
      ~ Professional Nerd. Freelance Programmer. ~

      1 Reply Last reply
      1
      • J Offline
        J Offline
        joseph
        Staff
        wrote on last edited by
        #3

        The apps itself run with minimal permissions but the Web Terminal gives you "root" access (this is a limited root and not server root) so that you can creates files as any user since some apps use multiple users. It's also required in situations where you restore/import the app and those files have different permissions than the one app uses.

        But tl;dr this is intended. Use su like @murgero said or you can use gosu <username> <cmd> as well

        1 Reply Last reply
        1
        • J joseph marked this topic as a question on
        • J joseph has marked this topic as solved on
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Bookmarks
        • Search