Grant Write Permission to specific user for Home directory

  • Hi guys,


    I'm currently using Snipe-IT, an asset manager, and it currently installed at /opt/snipeit .
    I recently receiving permission error when I'm upgrading b/c the composer needs to create its directory at home.
    I've created a user and group named snipeit.


    Code
    stat /home/
    
    
      File: ‘/home/’
      Size: 4096      	Blocks: 8          IO Block: 4096   directory
    Device: 801h/2049d	Inode: 262145      Links: 5
    Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)


    Code
    ls -la /home/
    total 20
    drwxr-xr-x  5 root root  4096 Nov 20  2016 .
    drwxr-xr-x 25 root root  4096 Nov 17 21:38 ..




    Whenever I upgrade, and run this commands,


    Code
    cd /opt/snipeit
    
    
    ....
    su snipeit -c 'php composer.phar install --no-dev --prefer-source'
    su snipeit -c 'php composer.phar dump-autoload'


    I receive this error:

    Code
    Cannot create cache directory /home/snipeit/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache Cannot create cache directory /home/snipeit/.composer/cache/files/, or directory is not writable. Proceeding without cache

    Home is a root directory.


    What's the best way to fix this?


    Thanks in advance.

    OMV v5.0
    Asus Z97-A/3.1; i3-4370
    32GB RAM Corsair Vengeance Pro

    2 Mal editiert, zuletzt von tinh_x7 ()

    • Offizieller Beitrag

    No one other than root can create anything in your /home/ directory. I'm also guessing snipeit doesn't create the snipeit home directory. I would do the following as root:


    mkdir /home/snipeit
    chown snipeit:users /home/snipeit

    omv 7.1.0-2 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.2 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.5 | scripts 7.0.7


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!