LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   ownership on ".." double dot directories. (https://www.linuxquestions.org/questions/linux-general-1/ownership-on-double-dot-directories-4175584098/)

chris_carr 07-08-2016 08:32 AM

ownership on ".." double dot directories.
 
ok I have a dumb question...I know, I know. all my question on here are dumb.

I created a user yesterday and when cd into their account and do a

ls -alh

I see something strange.

Code:

drwxr--r--  2 user1 country 4.0K Jul  8 07:14 .
drwxrwxr-- 15 SUPER-USER country 4.0K Jul  7 18:40 ..
-rw-r--r--  1 user1 country  18 Aug 17  2015 .bash_logout
-rwxr-xr--  1 root root      212 Jul  7 18:42 .bash_profile
-rw-r--r--  1 user1 country  124 Aug 17  2015 .bashrc
-rwxrwxrwx  1 user1 country  25 Jul  8 07:14 File1
-rwxrwxrwx  1 user1 country  25 Jul  8 07:14 File
-rwxr-xr--  1 root root      644 Jul  7 18:42 .profile


I want to know if there is a flag that can be used to specify changing ownership from SUPER-USER:Country back to user1:country on the ".." directory....I know its not a real directory but for the sake of this thread that is what I will refer to it as.

any help would be appreciated. I have changed it before, but been working like a dog lately, and cant remember how I did it.

hydrurga 07-08-2016 09:11 AM

.. is indeed a real directory, it's the one above the one you've listed (normally /home). If what you've listed is the user's home directory, you don't want to be giving them ownership of anything above that.

That's an unusual setup you have there. Normally /home has root root ownership. I've never heard of SUPER-USER as a user - it sounds like an artificial creation to me. Also .profile and .bash_profile normally have user ownership, not root.

Are you sure that this is Ubuntu you're running (according to the info in your sidebar)?

chris_carr 07-08-2016 09:41 AM

Quote:

Originally Posted by hydrurga (Post 5572520)
If what you've listed is the user's home directory, you don't want to be giving them ownership of anything above that.



that is true, I do not want them to have ownership of the directory above their home directory. Maybe I'm just dumb and not thinking about this correctly. I have just remember have to change this in the past or users were not able to get their .menu, but a command prompt instead. IDK. maybe I'm just too tired and not thinking straight. Thanks for you help.

ondoho 07-12-2016 09:54 AM

chris_carr, something is VERY, VERY WRONG with your system.

for comparison, this is what this command gives on my system (debian stable):
Code:

$ ls -alh
drwxr-xr-x 18 user  user  4.0K Jul 12 15:54 ./
drwxr-xr-x  5 root  root  4.0K Mar 14 16:16 ../
-rw-------  1 user  user  1.1K Jun 28 00:33 .profile
-rw-------  1 user  user  1.1K Mar 14 14:05 .bashrc
-rw-------  1 user  user  1.0K Jun 25 22:56 somefile.txt

i cut a few entries out, and changed my user name, but the principle remains:
1) there's no group "country"!
2) no file should have -rwxrwxrwx permissions, which equals 777.
3) .. should be root:root, and nothing else
4) ~/.profile should be user owned

are you sure you know what you're doing?

do you even understand the output of "ls -alh"?

chrism01 07-13-2016 03:48 AM

Actually a group country is certainly possible; its just unusual, especially on a home machine.
The rest is indeed very odd...

Smokey_justme 07-13-2016 04:23 AM

Let's forget the strange setup ... That's clearly his modification (and beside the SUPER-USER thing, that should simply be root, it's nothing that strange)...

@chris_carr: hydrurga already gave you the answer to this... "/home/user/.." is actually "/home" and changing the permission to one of them equals changing the other one...
Now here's the thing, the /home should have permision "drwxr-xr-x root:root" on your setup... This is important because of security reasons (only root should be able to create a file/directory there or delete one, others should be able just read that content and enter the directory). If you want a specific user to mangle that directory, use extended ACLs.

chris_carr 07-13-2016 07:41 AM

Thank you guys. I realized my mistake after a few more cups of coffee. not sure what I was thinking.

Glad everyone had a laugh at this. Trust me nobody is more confused by the set up than me....however I cant just go changing things willy nilly on a live production machine. on my QA box the permission are corrected, and that was after months of testing trying to get the right permissions to work with these stupid menus. I know it sounds and looks crazy, but trust me, you make one minor change to permissions and the menu no longer works. and for the record THIS IS NOT MY DESIGN. I was hired to clean this crap up.

ondoho 07-14-2016 02:21 AM

^ good, glad you see it & solved it.

Quote:

Originally Posted by chrism01 (Post 5575166)
Actually a group country is certainly possible; its just unusual.

can we talk about this for a while?
of course all this is possible on a linux box. that's the beauty of it.
but for almost all intents and purposes it is still wrong to do so.
i see this quite often, the long-time linux users and forum power posters start pointing out each other's logical mistakes, but for the OP with less than 10 posts and less than a year of linux experience, well the OP just needs some clear guidance & unambiguous explanations, no?

chris_carr 07-14-2016 09:32 AM

Of course we can still chat about this. I would love any input or suggestions to make my box more secure.


All times are GMT -5. The time now is 10:30 PM.