[SOLVED] New debian install - what permissions to give the user
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508
Original Poster
Rep:
Quote:
Originally Posted by TxLonghorn
Please post the result of the command:
Code:
ll /home
Here is the output:
Code:
user@debian:~$ ls -l
total 1017272
drwxrwxrwx 2 user user 4096 Feb 17 15:03 Desktop
drwxrwxrwx 7 user user 4096 Feb 20 21:28 Documents
drwxrwxrwx 2 user user 4096 Feb 19 10:17 Downloads
drwxrwxrwx 2 user user 4096 Feb 17 15:03 Music
drwxrwxrwx 2 user user 4096 Feb 19 14:12 Pictures
drwxrwxrwx 2 user user 4096 Feb 17 15:03 Public
drwxrwxrwx 2 user user 4096 Feb 17 15:03 Templates
drwxrwxrwx 2 user user 4096 Feb 17 15:03 Videos
user@debian:~$ ls -l
total 1017272
drwxrwxrwx 2 user user 4096 Feb 17 15:03 Desktop
drwxrwxrwx 7 user user 4096 Feb 20 21:28 Documents
drwxrwxrwx 2 user user 4096 Feb 19 10:17 Downloads
drwxrwxrwx 2 user user 4096 Feb 17 15:03 Music
drwxrwxrwx 2 user user 4096 Feb 19 14:12 Pictures
drwxrwxrwx 2 user user 4096 Feb 17 15:03 Public
drwxrwxrwx 2 user user 4096 Feb 17 15:03 Templates
drwxrwxrwx 2 user user 4096 Feb 17 15:03 Videos
That looks more like the listing of the /home/higgsboson directory (or whatever you call yourself), not /home.
You should run the latest command that TxLonghorn suggested.
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508
Original Poster
Rep:
Quote:
Originally Posted by TxLonghorn
Thanks to hydrurga for pointing out that "ll" is not used on all systems.
So to get the results for /home the command you need to run would be:
Code:
ls -la /home
Ok, this is the output:
Code:
user@debian:~$ ls -la /home
total 12
drwxr-xr-x 3 user user 4096 Feb 17 14:59 .
drwxr-xr-x 22 root root 4096 Feb 19 10:32 ..
drwxrwxrwx 23 user user 4096 Feb 22 15:02 user
That shows that you have only one user called "user", so there were no other users affected. That is good.
To change the owner of the /home directory back to root, as it should be, simply enter
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508
Original Poster
Rep:
Quote:
Originally Posted by TxLonghorn
That shows that you have only one user called "user", so there were no other users affected. That is good.
To change the owner of the /home directory back to root, as it should be, simply enter
Code:
sudo chown root:root /home
I have now done this. However, I now get the output:
Code:
root@debian:/home/user# ls -la /home
total 12
drwxr-xr-x 3 root root 4096 Feb 17 14:59 .
drwxr-xr-x 22 root root 4096 Feb 19 10:32 ..
drwxrwxrwx 23 user user 4096 Feb 22 15:02 user
Doesn't this mean 'user' still rwx ownership of /home?
I have now done this. However, I now get the output:
Code:
root@debian:/home/user# ls -la /home
total 12
drwxr-xr-x 3 root root 4096 Feb 17 14:59 .
drwxr-xr-x 22 root root 4096 Feb 19 10:32 ..
drwxrwxrwx 23 user user 4096 Feb 22 15:02 user
Doesn't this mean 'user' still rwx ownership of /home?
No.
The three entries refer to three separate directories.
The first entry refers to /home - root owns this
The second entry refers to / - root owns this
The third entry refers to /home/user - user owns this
"rwx" and ownership are separate filesystem characteristics, so "rwx ownership" doesn't make much sense.
I have to say however, on a rwx basis, my system has rwx------ for /home/user, but perhaps this is simply a difference in how our respective systems are set up.
I have to say however, on a rwx basis, my system has rwx------ for /home/user, but perhaps this is simply a difference in how our respective systems are set up.
Right. Mine is the same as Higgsboson.
Now, to fix the ownership on your data partition, post the result of
Code:
sudo lsblk -o name,size,fstype,mountpoint,label
and tell us the which is the one you want to access.
The two data partitions the user needs to access will be sda6 and sda7.
I'll be doing this for all the sole users on my other OSs.
However, from a best practice point of view, what ownership/permission should the user be assigned?
I think this is important for me to learn because previously my users tended to have similar privileges to root.
It has just occurred to me that 'user' still has ownership of /home on my other OSs.
In which case, if I booted each OS and ran the cmd
Code:
chown root:root /home
will this return ownership of /home to root as it has done with this OS?
Last edited by Higgsboson; 02-22-2016 at 11:32 AM.
However, from a best practice point of view, what ownership/permission should the user be assigned?
I think this is important for me to learn because previously my users tended to have similar privileges to root.
You can create standard users who do not have sudo privileges, and you can create administrative users who do have sudo rights.
Quote:
Originally Posted by Higgsboson
The two data partitions the user needs to access will be sda6 and sda7.
Do you want to automount sda6 and sda7 everytime you boot, or do you just want to mount them whenever you need them?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.