[Question] Permissions

I recently just setup my drives to automatically mount on bootup and I was wanting to setup a new user called nginx to have a directory of it’s own.

Ever since I’ve set this up the sudo password of my main users is not working any ore, so I can’t really do much. I can still log into root and change stuff there, however what I’m wanting is have the nginx account confined into one location since it only needs to touch the webserver I’m assuming?

I’ve also tried resetting my sudo password from root and it says the password is wrong.

Here is what I did:

  • After running this command it seemed fine, however I’m not sure if it was this that caused the problem or not:

    sudo useradd  nginx -d /home/blood/mounts/devwork/website/nginx -m nginx -p password
    
  • I then switched to the nginx user and got permission denied.

    su nginx
    

    bash: /home/bloodshotpico/mounts/devwork/website/nginx/ .bashrc: Permission Denied`

  • Then this is where I noticed my sudo password was broken trying to run this command.

    sudo chown -R nginx /home/bloodshotpico/mounts/devwork/website/nginx
    
  • Having a weird feeling about this I tried changing the password and to alas nothing really changed it still says it’s wrong.

  • So I logged in as root and tried changing the permission of the file back to my main account. I’m honestly not sure if that was a good idea and what I have broken following this or how to fix it. And then how to go about fixing it and setting this up the way I wanted to in the first place.

Any help would be greatly appreciated. I’m still learning and am having fun doing so but also not.

:cry:

not sure - just ideas:
the way you created that user is unusual and you seem to have missed to define some things, namely the user name …

are you trying to set up a new users home directory inside your own home directory?

what does the command
groups
return for that user?
A user has to be a member of several groups in order to be able to do certain things.
I think the “wheel” group is the one a user has to be in in order to use su or sudo to become super user.

I did put a user sorry I just didn’t type it out on here correctly. The user name was nginx.

I’m trying to get the user setup in a different drive, but I don’t want that entire drive to be for that user since I want to do other dev work on other users in that drive.

It’s my main account that has problems with the sudo command and it worked before I made the new user being “nginx” my main user is called “bloodshotpico” so bloodshotpico is the user having trouble with the sudo commands.

Sudo password worked before this and it was a different password from that of root.

~Blood

this is getting more confusing …
Does that mean that your user password now does not work?
You can log in but not use sudo to do root tasks?

whoami
is a command to check
… who you currently are to the system

I’m doing this mostly via console and I’m logged in currently as bloodshotpico and I just checked it seems like my password is working now, I feel like when I reverted the change mentioned above that has fixed it. Or the other possibility being it just didn’t work for that command I was trying to run?

I’m honestly not really sure. But there is the two ideas I had.

~Blood

Make a dedicated partition on it, a filesystem too ;), and mount it to /home/that_users_name
or
just create one partition
and one dedicated directory on it
and mount that directory to /home/that_users_name
That way, the entire drive capacity is accessible to it
but you can create other directories on that drive and mount them to other places
using the drives capacity for those as well.

This way you keep all your users where they belong:
under /home/$username

I’ll have to tinker around with this since I’m not sure I 100% understand what you’re saying from my lack of knowledge, however I believe I should be able to figure it out when I get to have another look at this. :slight_smile:

Thanks for the help and feedback.
~Blood

  1. What is the output of groups in your user?
  2. What is the content of /etc/sudoers?

is wrong.

Try simpler with:

 sudo useradd nginx --password=szPasswordNotContainingAnySpaces

after the above is sorted and use the standards before you start doing complex things as that will confine user nginx to its own home directory /home/nginx

:stuck_out_tongue_winking_eye: