How to setup a user to specific directory?

You’d make that directory owned by you - just like the whole rest of your $HOME directory.

Or make it accessible to everyone with read/write/execute permissions
but I think this is not a good idea and unnecessary
since the directory is located inside your $HOME
where, usually, no one else has access anyway and can’t even get to it (without knowing the name and location)

That’s why I was wondering if there was a way to have all users have access to the entire drive except the website stuff on that drive. :stuck_out_tongue:

~Blood

Maybe I still misunderstand you.

With a dedicated directory on the /dev/sdc1 drive (a directory called: “devwork”)
you can use that to mount it to where you need it

while you still can create other directories on that drive in the same way
and mount those to different places.

That way, the space on the one partition
can be used for different things
by mounting and using the different directories …

You can have different mounts for different users?

Or am I getting that wrong?

~Blood

Yes.
But I think we are talking past each other.
Let me think of a different way to express myself. :wink:

Okay sorry, it’s just very confusing for me since it’s still way over my head honestly.

But thanks for being patient.
~Blood

In the meantime … you could start trying what was said so far - thus learning by doing :wink:
unmount the drive
comment out the /etc/fstab entry for it, for now (put a # in front of the line)
mount it to /mnt (for example)
create a directory on it
(there currently shouldn’t be any)
give it user permissions
check the effect with ls -al /mnt
unmount the drive from /mnt
and mount it to … different places/directories
sudo mount /dev/sdc1 /home/user or any other place
check the effect with ls -al and df -h
or use GUI tools to do the same

You say give it user permissions however I’m not sure what you mean by that, give it what permissions exactly? And to which user?

~Blood

ls -al in your $HOME will give you the permissions and the names of the user and group
chown -R user:group /mnt/devworks (just an example) will do just that - change owner from root:root to user:group
with chmod you can adapt the permissions
there are manual pages for every command, explaining how to use it
man chown
man chmod

Do I need to find my users and groups myself or does user:group work for all users and groups as a default?

~Blood

you need to find out yourself

that’s why you check with ls -al in your $HOME
or, alternatively, you know which user and group you have and want to be able to access the drive …

user:group
is just generic

cat /etc/group
will list all the users and which group they belong, currently

Is it best to also have a group for this or is a user fine as is?

Also I’ve tried to change a directory within the devwork directory to be under the owner of nginx and for some reason it’s saying it can’t find the directory, however I can cd into the directory it’s saying it can’t find?

chown: cannot access 'mnt/devwork/website': No such file or directory
[BloodDev ~]# chown -hR nginx mnt/devwork/website

However:

[BloodDev ~]# cd /mnt/devwork/website
[BloodDev website]#

~Blood

You don’t have to setup any nginx users.

Running nginx on Manjaro or Arch is using a user:group as http:http.

Adding your self to the http group will allow your user to work with the files.

However - using the su http command will allow you to work with files as the http user which may be what you are looking for.

it’s:
/mnt/devwork/website
you forgot the slash

you’ll also need to run that command with sudo since the directory was created and is owned by root

ls -al
use it to check before and after …

This is the last time I ever listen to a friend of mine…

I asked him if it would be a good idea, and he turned around and said it’s not needed but it is a good idea and he’s been using linux way more than me, probably a good 5-6 years, he uses it as his main OS.

So I just need to install nginx correct and that’s it? Won’t I need to change stuff if I move around the directory it launches from?

Ah I see, well it seems like this has been wrong all along since linux-aarhus says it’s not needed for nginx.

Well - I have no idea what you are trying to accomplish - suffice to say - I am running sites using nginx on Manjaro - and it works great.

I run an official Manjaro mirror using nginx on a Manjaro powered system.

I am running several other sites of the same server using nginx - I have been around most of the issues surround running nginx on Arch based systems.

Well - you still want to use /dev/sdc1 as a storage and mount it to the place where you want the storage.
Thus, you still need the proper permissions …

Basically wanting a secure area to have the website run in, since well I’ve been bad with security in the past, and was told I can run it out of a different directory, which gave me the idea of having a user specifically for the webserver only.

Meaning that user can change the webserver along with root and it wouldn’t be able to change anything else on the machine. After I was going to get this all setup I was going to run Discourse along side it. But I’m way more confused now as I’m not sure what steps I need to retake and or untake.

TLDR; Want to run a website and Discourse forums securely.

I have a separate drive for storage specifically but, what I think you’re trying to say is I need to setup the dev drive so all users have access to it still correct?

~Blood