LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-08-2016, 08:32 AM   #1
chris_carr
Member
 
Registered: Oct 2011
Location: Houston Tx
Distribution: RHEL 6
Posts: 57

Rep: Reputation: 0
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.

Last edited by chris_carr; 07-08-2016 at 08:34 AM.
 
Old 07-08-2016, 09:11 AM   #2
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
.. 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)?
 
Old 07-08-2016, 09:41 AM   #3
chris_carr
Member
 
Registered: Oct 2011
Location: Houston Tx
Distribution: RHEL 6
Posts: 57

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by hydrurga View Post
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.
 
Old 07-12-2016, 09:54 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
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"?
 
Old 07-13-2016, 03:48 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Actually a group country is certainly possible; its just unusual, especially on a home machine.
The rest is indeed very odd...
 
Old 07-13-2016, 04:23 AM   #6
Smokey_justme
Member
 
Registered: Oct 2009
Distribution: Slackware
Posts: 534

Rep: Reputation: 203Reputation: 203Reputation: 203
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.
 
Old 07-13-2016, 07:41 AM   #7
chris_carr
Member
 
Registered: Oct 2011
Location: Houston Tx
Distribution: RHEL 6
Posts: 57

Original Poster
Rep: Reputation: 0
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.
 
Old 07-14-2016, 02:21 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
^ good, glad you see it & solved it.

Quote:
Originally Posted by chrism01 View Post
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?
 
Old 07-14-2016, 09:32 AM   #9
chris_carr
Member
 
Registered: Oct 2011
Location: Houston Tx
Distribution: RHEL 6
Posts: 57

Original Poster
Rep: Reputation: 0
Of course we can still chat about this. I would love any input or suggestions to make my box more secure.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Creating new directory without including "." and ".." hidden directories Abhiandy108 Linux - Newbie 15 05-20-2016 08:53 AM
what is the meaning of "e" in "double freq = 914.0e6; // frequency" er.poojasahu@gmail.com Linux - Wireless Networking 3 12-17-2013 01:57 AM
LXer: Use "pushd" and "popd" for quick switching between directories LXer Syndicated Linux News 0 07-13-2012 07:40 PM
K3b: - Howto re-dock "Directories" and "Contents" windows back into the main window? hagies Linux - Software 4 04-26-2006 08:38 AM
Why doesn't a wildcard chmod change "dot" files/directories? jht2k Linux - General 1 08-09-2004 02:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:33 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