Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Help with file permissions for . and .. [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
linuxn00bie255
n00b
n00b


Joined: 04 Dec 2005
Posts: 58

PostPosted: Thu Mar 09, 2006 5:04 pm    Post subject: Help with file permissions for . and .. [SOLVED] Reply with quote

Alright alright before you read this, I know what I did was stupid, so keep that in mind as you read. Alright, so anyway I was annoyed because as a normal user I wanted to be able to tab complete places like /mnt and /tmp. So I thought it was a file permissions problem with . and .. So I went to / and did chmod +rx . and chmod +rx .. I was doing a gentoo install on another system I had laying around, and ran into the same problem. But then I started to wonder what did I actually do. Well I thought about it, and realized I basically gave an intelligent user enough power to run anything they wanted...

Testing my theory I was able to use ifconfig by going to the directory and using ./ifconfig. However if I just plain type ifconfig, nothing happens and it says it can't find the command (as I assume it should, if you are logging in as a standard user). Is there a way to fix this problem? Or a way to set it back to the original permissions? Since I only changed . and .. I thought maybe there was some hope...

*sigh* lol Thanks in advance ! 8O


Last edited by linuxn00bie255 on Fri Mar 10, 2006 5:07 am; edited 1 time in total
Back to top
View user's profile Send private message
widu
Guru
Guru


Joined: 05 Jun 2004
Posts: 333
Location: Freiburg

PostPosted: Thu Mar 09, 2006 5:35 pm    Post subject: Re: Help with file permissions and the chaos I have created Reply with quote

linuxn00bie255 wrote:


Testing my theory I was able to use ifconfig by going to the directory and using ./ifconfig. However if I just plain type ifconfig, nothing happens and it says it can't find the command (as I assume it should, if you are logging in as a standard user). Is there a way to fix this problem?

yes there is a way.
the problem is your PATH environmental variable. It defines the directories that are searched by the bash for executables.
if you want to see wath your PATH contains just type:
Code:
echo $PATH

the different directories are seperated by a colon.
So if you want to ad the directory where ifconfig resides to your PATH open .bashrc (in your home directory) in your favorit editor and add a line
Code:
PATH="$PATH:/sbin"

start a new console and now it should find ifconfig without the full path.
Quote:

Or a way to set it back to the original permissions? Since I only changed . and .. I thought maybe there was some hope...
8O

Since / by default has got read and execute permissions for everybody, you didn't change anything with you chmod command and there's nothing to repair
_________________
nature is a heterosexual fiction
Back to top
View user's profile Send private message
linuxn00bie255
n00b
n00b


Joined: 04 Dec 2005
Posts: 58

PostPosted: Thu Mar 09, 2006 6:21 pm    Post subject: Reply with quote

I'm not quite sure I under or you understand by dilema. Based on what you are saying, normal users should be able to execute ifconfig?

I was under the impression that ifconfig along with other things were off limits, unless you were root that is. Now that I chmod . and .. to have rx permissions for everyone I can tab complete as I desire, but I wasn't sure if I was supposed to be able to execute commands like ifconfig or not...

Or, are you saying that what . and .. are don't make a difference, but that it only matters per file?

Sorry for you confusion, and thank you for your help!
Back to top
View user's profile Send private message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Thu Mar 09, 2006 6:53 pm    Post subject: Reply with quote

linuxn00bie255 wrote:
I'm not quite sure I under or you understand by dilema. Based on what you are saying, normal users should be able to execute ifconfig?
Or, are you saying that what . and .. are don't make a difference, but that it only matters per file?


ifconfig is a bit of a special case, and not a good example here. As a normal user you should be able to run it with
Code:
 /sbin/ifconfig
and it will show you the current config, but if you try
Code:
/sbin/ifconfig eth0 down
the command will run, but you wont have permissions for the command to complete properly and it *should* error.

. and .. are the current and parent directory, which should have the x flag set for any of the users that are allowed to access it, whether this is just the owner (dr?x??????), a group member(d???r?x???), or everyone (d??????r?x).
Back to top
View user's profile Send private message
linuxn00bie255
n00b
n00b


Joined: 04 Dec 2005
Posts: 58

PostPosted: Thu Mar 09, 2006 7:12 pm    Post subject: Reply with quote

ahhhhhhhhhh! Thank you! That makes a lot more sense now. In essence I did what I should have, by adding the permissions, I just didn't fully understand what it meant, haha.

Thanks again guys!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum