[SOLVED] Local external storage : "You don't have permission to send or create files here" / [RESOLU] Stockage externe local : "Vous n’avez pas la permission d'envoyer ou de créer des fichiers ici

Bonjour,
J’ai installé Nextcloud sur Yunohost 3.6.4.6 sur une machine serveur chez moi pour apprendre à utiliser Yunohost. J’ai ajouter un deuxième disque dur sur cette machine pour ouvoir augmenter ma capacité de stockage et j’ai alors créé un stockage externe local dans Nextcloud avec comme configuration : “/media/Backup”.

  1. J’ai monté de façon permanente ce disque dans le fstab en ajoutant la ligne : UUID=xxxxxxxxxxxxxxxxxxxxxxxx /media/Backup ext4 defaults 0 2.
  2. D’après ce que j’ai lu , j’ai modifié le propriétaire avec la commande : chown -R www-data:www-data /media/Backup
  3. J’ai aussi modifié les droits d’accès pour le répertoire en 750 (rwx/r-x /—) avec la commande : chmod -R 750 /media/Backup et pour les fichiers en 642 (rw-/r–/-w-) avec la commande : chmod -R 642 Backup/.

Cependant, j’ai toujours le message “Vous n’avez pas la permission d’envoyer ou de créer des fichiers ici” quand je suis dans le répertoire “Backup”. Une petite idée ?

Merci de votre aide et longue vie à Yunohost !


Hello,
I installed Nextcloud on Yunohost 3.6.4.4.6 on a server machine at home to learn how to use Yunohost. I added a second hard disk on this machine to increase my storage capacity and then created a local external storage in Nextcloud with the configuration: “/media/Backup”.

  1. I permanently mounted this disk in the fstab by adding the line : UUID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx /media/Backup ext4 defaults 0 2.
  2. From what I read, I changed the owner with the command: chown -R www-data:www-data /media/Backup
  3. I also changed the access rights for the directory in 750 (rwx/r-x /—) with the command : chmod -R 750 /media/Backup and for the files in 642 (rw-/r–/-w-) with the command : chmod -R 642 Backup/.

However, I still get the message “You don’t have permission to send or create files here” when I’m in the “Backup” directory. Any idea?

Thank you for your help and long live Yunohost!

EDIT : solution trouvée par ce lien : https://yunohost.org/#/app_nextcloud en suivant la solution II cas A et en sautant l’étape de migration des données.

En root (sudo su) :

  1. Eteindre le serveur web avec la commande: systemctl stop nginx
  2. Choix d’un stockage exclusif à Nextcloud
    Comme pour l’instant seul root peut écrire dans /media/Backup, nginx et nextcloud ne peuvent donc pas l’utiliser donc :
    chown -R nextcloud:nextcloud /media/Backup
    chmod 775 -R /media/Backup
  3. Pour informer Nextcloud de son nouveau répertoire, modification du fichier /var/www/nextcloud/config/config.php avec la commande:
    nano /var/www/nextcloud/config/config.php
    Modifiez la ligne: ‘datadirectory’ => ‘/home/yunohost.app/nextcloud/data’ ,
    en
    ‘datadirectory’ => ‘/media/stockage’,
  4. Relancer le serveur web : systemctl start nginx
  5. Ajouter le fichier .ocdata à l’aide de la commande : nano /media/Backup/.ocdata
    Ajouter un espace au fichier pour pouvoir le sauvegarder
  6. Lancez un scan du nouveau répertoire par Nextcloud avec :
    cd /var/www/nextcloud
    sudo -u nextcloud php occ files:scan --all

EDIT: solution found by this link: https://yunohost.org/#/app_nextcloud by following solution II case A and skipping the data migration step.

As root (sudo su):

  1. Shut down the web server with the command: systemctl stop nginx
  2. Choice of an exclusive storage for Nextcloud
    As for the moment only root can write in /media/Backup, so nginx and nextcloud can’t use it so:
    chown -R nextcloud:nextcloud /media/Backup
    chmod 775 -R /media/Backup
  3. To inform Nextcloud of its new directory, modify the file /var/www/nextcloud/config/config.php with the command:
    nano /var/www/nextcloud/config/config/config.php
    Modify the line:‘datadirectory’ =>’/home/yunohost.app/nextcloud/data’ ,
    in
    “datadirectory” =>"/media/storage",
  4. Restart the web server: systemctl start nginx
  5. Add the.ocdata file using the command: nano /media/Backup/.ocdata
    Add a space to the file to be able to save it
  6. Run a scan of the new directory by Nextcloud with :
    cd /var/www/nextcloud
    sudo -u nextcloud php occ files:scan --all
1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.