I do not get why people all over the place mix two commands which do the same thing
. Use:
sudo -s
Do not use su, unless you know that you must use it for some reason. It is dangerous as it does not start with a fresh environment by default, and is not logged transparently like a sudo session.
To avoid the need to manually create these dot files (and the new data dir itself), and avoid unintentionally missing other dot files, my howto uses
cp -a /path/to/data/. /new/path/to/data
Note the . instead of *, so it copies the directory itself (recursively), instead of its content, with the wildcard that does not match dot files.
Uff, every user now has full write access to your Nextcloud dataâs parent directory. Do not do that! Every user can now create a .htaccess in this directory, and Apache respect those on every parent directory. That way really everything can be exposed easily to the public. Never create a 777 dir anywhere on the system. I really do not know a single use case for this. Always use the users these dirs shall finally be owned to, max 775 when selected multiple users require write access. In this particular case, Iâd clearly leave it as default 755 and owned by root user, like all parent dirs of Nextcloud data, for security reasons.
The owner of symlinks is irrelevant, as it has 777 mode by default, which does not matter either since the target directory permissions are what counts. EDIT: I see even my HowTo contained this step. It is however not required
.
Basically, was there a particular step of my HowTo which did not work, so that you needed to go you own less secure steps? My aim writing HowToâs is not only to make it easier, but also to make it more secure for people to do things, especially when it is about such sensitive things like private data exposed to the web, which is so easy to break. So I failed this aim, if for some reason people still go their own ways after reading my HowTo, weakening their data security
.
EDIT: @c0ldfyr3 and others: I updated the HowTo with some unnecessary commands removed, better formatting, using Markdown code fences for copy button and adding the use of variables for all relevant paths and credentials. So it should be possible to do a lot more copy&paste without manually replacing arguments. Also sudo was added to all commands where it is usually required + a note about sudo -s as alternative. Please see whether something could still be better. I hope I did no typo/mistake in the edit
.