LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 02-22-2016, 08:09 AM   #16
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231

Quote:
Originally Posted by Higgsboson View Post
Is there any way of returning ownership of /home to root?
Please post the result of the command:
Code:
ll /home
 
Old 02-22-2016, 09:00 AM   #17
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by Higgsboson View Post
Yes, this command is a little more intuitive. Did you do this yourself?
Well, my Linux user/group name isn't actually hydrurga, but yes, I have used that command in that format in the past.
 
1 members found this post helpful.
Old 02-22-2016, 09:08 AM   #18
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by TxLonghorn View Post
Please post the result of the command:
Code:
ll /home

Code:
root@debian:/home/user# ll /home
bash: ll: command not found
For some reason it's not seeing the command.
 
Old 02-22-2016, 09:33 AM   #19
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by Higgsboson View Post
Code:
root@debian:/home/user# ll /home
bash: ll: command not found
For some reason it's not seeing the command.
ll is an alias for ls -l or ls -lF (or ls with other parameters!), but not on all systems.

You can post the results of ls -l (or ls -la in case there are any hidden files/directories) instead.

Last edited by hydrurga; 02-22-2016 at 09:35 AM.
 
1 members found this post helpful.
Old 02-22-2016, 09:52 AM   #20
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by TxLonghorn View Post
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
 
Old 02-22-2016, 09:58 AM   #21
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
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
 
Old 02-22-2016, 10:00 AM   #22
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by Higgsboson View Post
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
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.

Last edited by hydrurga; 02-22-2016 at 10:02 AM.
 
Old 02-22-2016, 10:02 AM   #23
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by TxLonghorn View Post
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
 
Old 02-22-2016, 10:23 AM   #24
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
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
 
Old 02-22-2016, 10:36 AM   #25
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by TxLonghorn View Post
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?
 
Old 02-22-2016, 10:43 AM   #26
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by Higgsboson View Post
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.
 
Old 02-22-2016, 10:52 AM   #27
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by hydrurga View Post
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.
 
Old 02-22-2016, 11:12 AM   #28
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by hydrurga View Post
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
I see. This is very helpful to know as it's not so clear from the output.

Quote:
"rwx" and ownership are separate filesystem characteristics, so "rwx ownership" doesn't make much sense.
Yes, I should've said rwx permission, as opposed to 'ownership'.
 
Old 02-22-2016, 11:21 AM   #29
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by TxLonghorn View Post
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.
This is what I get:
Code:
root@debian:/home/user# lsblk -o name,size,fstype,mountpoint,label
NAME     SIZE FSTYPE MOUNTPOINT LABEL
fd0        4K                   
sda    149.1G                   
├─sda1  39.1G ext4              
├─sda2  39.1G ext4              
├─sda3  39.1G ext4              
├─sda4     1K                   
├─sda5     4G swap   [SWAP]     
├─sda6  14.3G ext4              
└─sda7  13.6G ext4              
sdb    931.5G                   
├─sdb1   160G ntfs              
├─sdb2    15G ext4              
└─sdb4   100G ext4   /          
sr0     1024M
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.
 
Old 02-22-2016, 11:34 AM   #30
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by Higgsboson View Post
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 View Post
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?

Running that command on the other OS's is fine.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I give added permissions when using su to run a command as another user? PastulioLive Linux - Server 4 01-12-2016 10:56 AM
How to give an user the printing permissions? Xeratul Debian 4 05-23-2014 05:15 AM
How to Give Read Write Permissions to a Particular User on a Folder Nanosuz Linux - General 1 08-16-2013 10:21 AM
how to give user bigger write permissions nephish Linux - Security 5 12-15-2006 12:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration