How can I make a specific root folder accessible for a user?












1















I have installed Nextcloud via snaps, and it stores its files under /var/snap/nextcloud/common/nextcloud/data/FriedRose/files, owned by root. I like to give my normal user access to read and write to /var/snap/nextcloud/common/nextcloud/data/FriedRose/files/downloads.



How can I achieve this without creating a security risk or breaking the snap package? Is giving all directories in this path the executable permission, and giving the downloads directors read and write permission, a good solution? (chmod a+x ...). If this is a good solution, then is there a way to automatically do it or should I write a little function to break up a path into all its directories?










share|improve this question























  • Here is one possible solution: askubuntu.com/a/1024308/566421 But probably @olivierb2's answer is more correct.

    – pa4080
    Jan 10 at 9:36
















1















I have installed Nextcloud via snaps, and it stores its files under /var/snap/nextcloud/common/nextcloud/data/FriedRose/files, owned by root. I like to give my normal user access to read and write to /var/snap/nextcloud/common/nextcloud/data/FriedRose/files/downloads.



How can I achieve this without creating a security risk or breaking the snap package? Is giving all directories in this path the executable permission, and giving the downloads directors read and write permission, a good solution? (chmod a+x ...). If this is a good solution, then is there a way to automatically do it or should I write a little function to break up a path into all its directories?










share|improve this question























  • Here is one possible solution: askubuntu.com/a/1024308/566421 But probably @olivierb2's answer is more correct.

    – pa4080
    Jan 10 at 9:36














1












1








1








I have installed Nextcloud via snaps, and it stores its files under /var/snap/nextcloud/common/nextcloud/data/FriedRose/files, owned by root. I like to give my normal user access to read and write to /var/snap/nextcloud/common/nextcloud/data/FriedRose/files/downloads.



How can I achieve this without creating a security risk or breaking the snap package? Is giving all directories in this path the executable permission, and giving the downloads directors read and write permission, a good solution? (chmod a+x ...). If this is a good solution, then is there a way to automatically do it or should I write a little function to break up a path into all its directories?










share|improve this question














I have installed Nextcloud via snaps, and it stores its files under /var/snap/nextcloud/common/nextcloud/data/FriedRose/files, owned by root. I like to give my normal user access to read and write to /var/snap/nextcloud/common/nextcloud/data/FriedRose/files/downloads.



How can I achieve this without creating a security risk or breaking the snap package? Is giving all directories in this path the executable permission, and giving the downloads directors read and write permission, a good solution? (chmod a+x ...). If this is a good solution, then is there a way to automatically do it or should I write a little function to break up a path into all its directories?







permissions filesystem security root snap






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 10 at 8:54









HappyFaceHappyFace

1247




1247













  • Here is one possible solution: askubuntu.com/a/1024308/566421 But probably @olivierb2's answer is more correct.

    – pa4080
    Jan 10 at 9:36



















  • Here is one possible solution: askubuntu.com/a/1024308/566421 But probably @olivierb2's answer is more correct.

    – pa4080
    Jan 10 at 9:36

















Here is one possible solution: askubuntu.com/a/1024308/566421 But probably @olivierb2's answer is more correct.

– pa4080
Jan 10 at 9:36





Here is one possible solution: askubuntu.com/a/1024308/566421 But probably @olivierb2's answer is more correct.

– pa4080
Jan 10 at 9:36










1 Answer
1






active

oldest

votes


















1














You shouldn't access directly to this data folder, and file modification will break your nextcloud instance as it store many meta data (file size, file hash, etc...) into a database.



If you need to share a folder between Nextcloud and a local user, you should use External Storage which is a Nextcloud module.



https://docs.nextcloud.com/server/14/admin_manual/configuration_files/external_storage_configuration_gui.html



With this module, you will be able to add an external storage as folder (choose Local as Storage) and choose any folder on your hard drive where you will store your data.






share|improve this answer
























  • No, Nextcloud has a scan command that syncs between the data folder and the database. (I have tested it.) And external storage doesn’t work because snaps are isolated.

    – HappyFace
    Jan 10 at 9:27











  • Scan command is used to repair database. Free to HappyFace to create a new folder within the Snap.

    – olivierb2
    Jan 10 at 9:37











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1108518%2fhow-can-i-make-a-specific-root-folder-accessible-for-a-user%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














You shouldn't access directly to this data folder, and file modification will break your nextcloud instance as it store many meta data (file size, file hash, etc...) into a database.



If you need to share a folder between Nextcloud and a local user, you should use External Storage which is a Nextcloud module.



https://docs.nextcloud.com/server/14/admin_manual/configuration_files/external_storage_configuration_gui.html



With this module, you will be able to add an external storage as folder (choose Local as Storage) and choose any folder on your hard drive where you will store your data.






share|improve this answer
























  • No, Nextcloud has a scan command that syncs between the data folder and the database. (I have tested it.) And external storage doesn’t work because snaps are isolated.

    – HappyFace
    Jan 10 at 9:27











  • Scan command is used to repair database. Free to HappyFace to create a new folder within the Snap.

    – olivierb2
    Jan 10 at 9:37
















1














You shouldn't access directly to this data folder, and file modification will break your nextcloud instance as it store many meta data (file size, file hash, etc...) into a database.



If you need to share a folder between Nextcloud and a local user, you should use External Storage which is a Nextcloud module.



https://docs.nextcloud.com/server/14/admin_manual/configuration_files/external_storage_configuration_gui.html



With this module, you will be able to add an external storage as folder (choose Local as Storage) and choose any folder on your hard drive where you will store your data.






share|improve this answer
























  • No, Nextcloud has a scan command that syncs between the data folder and the database. (I have tested it.) And external storage doesn’t work because snaps are isolated.

    – HappyFace
    Jan 10 at 9:27











  • Scan command is used to repair database. Free to HappyFace to create a new folder within the Snap.

    – olivierb2
    Jan 10 at 9:37














1












1








1







You shouldn't access directly to this data folder, and file modification will break your nextcloud instance as it store many meta data (file size, file hash, etc...) into a database.



If you need to share a folder between Nextcloud and a local user, you should use External Storage which is a Nextcloud module.



https://docs.nextcloud.com/server/14/admin_manual/configuration_files/external_storage_configuration_gui.html



With this module, you will be able to add an external storage as folder (choose Local as Storage) and choose any folder on your hard drive where you will store your data.






share|improve this answer













You shouldn't access directly to this data folder, and file modification will break your nextcloud instance as it store many meta data (file size, file hash, etc...) into a database.



If you need to share a folder between Nextcloud and a local user, you should use External Storage which is a Nextcloud module.



https://docs.nextcloud.com/server/14/admin_manual/configuration_files/external_storage_configuration_gui.html



With this module, you will be able to add an external storage as folder (choose Local as Storage) and choose any folder on your hard drive where you will store your data.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 10 at 9:22









olivierb2olivierb2

1,87989




1,87989













  • No, Nextcloud has a scan command that syncs between the data folder and the database. (I have tested it.) And external storage doesn’t work because snaps are isolated.

    – HappyFace
    Jan 10 at 9:27











  • Scan command is used to repair database. Free to HappyFace to create a new folder within the Snap.

    – olivierb2
    Jan 10 at 9:37



















  • No, Nextcloud has a scan command that syncs between the data folder and the database. (I have tested it.) And external storage doesn’t work because snaps are isolated.

    – HappyFace
    Jan 10 at 9:27











  • Scan command is used to repair database. Free to HappyFace to create a new folder within the Snap.

    – olivierb2
    Jan 10 at 9:37

















No, Nextcloud has a scan command that syncs between the data folder and the database. (I have tested it.) And external storage doesn’t work because snaps are isolated.

– HappyFace
Jan 10 at 9:27





No, Nextcloud has a scan command that syncs between the data folder and the database. (I have tested it.) And external storage doesn’t work because snaps are isolated.

– HappyFace
Jan 10 at 9:27













Scan command is used to repair database. Free to HappyFace to create a new folder within the Snap.

– olivierb2
Jan 10 at 9:37





Scan command is used to repair database. Free to HappyFace to create a new folder within the Snap.

– olivierb2
Jan 10 at 9:37


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1108518%2fhow-can-i-make-a-specific-root-folder-accessible-for-a-user%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

Mangá

 ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕