LinuxQuestions.org
Visit Jeremy's Blog.
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 05-02-2007, 09:57 AM   #1
leprkhn
LQ Newbie
 
Registered: Dec 2006
Posts: 27

Rep: Reputation: 15
directory permission


i am running debian etch on a machine that dual boots with winxp. i would like to access one of my nfts partitions (the one with all the music). i tried going at it through /dev/hdb5 but realized that i had to mound it first. so i mounted it at /mnt/win ( #mount -t ntfs /dev/hdb5 /mnt/win ). when i try to access /mnt/win/Music through konqueror the icon has a little lock on it and clicking gets a "you dont have enough permissions to read" message.
so i thought i'd just copy the directory /mnt/win/Music to /home/leprkhn ( #cp -r /mnt/win/Music /home/leprkhn )
and it worked!
the directory is now also in /home/leprkhn/
except that when i try to access it i still get the "you do not have enough permissions to read" message.
how do i get proper permissions? i am the only user on the machine... and id really like to know how to do this.

thank you

lep
 
Old 05-02-2007, 10:14 AM   #2
deroB
Member
 
Registered: Dec 2005
Location: Sydney, Australia
Distribution: Arch Linux
Posts: 208

Rep: Reputation: 30
have a look and the chmod man page
Code:
man chmod
or look here for some examples:
http://www.ss64.com/bash/chmod.html

the page above has a nice "applet" that will help you decide how to chage the permissions

if you just want everyone to be able to read, write and excecute
you would type [as root since you dont have permissions yet]
Code:
chmod 777 [filename]
 
Old 05-02-2007, 10:38 AM   #3
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
as an alternative:

cd /mnt/win
chown -R username *
 
Old 05-02-2007, 10:45 AM   #4
leprkhn
LQ Newbie
 
Registered: Dec 2006
Posts: 27

Original Poster
Rep: Reputation: 15
excellent!
that did the trick.

#chmod -R -v 777 /home/leprkhn/Music

made it fully accessible.
i get the feeling though that fully accessible isn't a good thing.
i tried:
#chmod -Rv 444 /home/leprkhn/Music
but then JuK wouldnt play any of them....

so i want back to full.
one question though: am i correct in assuming that giving full access to a directory like that is bad form from a security standpoint?

thanks for the help

lep
 
Old 05-02-2007, 10:57 AM   #5
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
Well, there are better decisions you could take from a security point of view. 777 means anyone can change all your files in that directory. Here is the idea:

the number has three parts: user / group /others
Each number represents the permissions :
4 =read permissions
2= write permissions
1 = execute permissions (=required to be able to access a directory, among other things).
The numbers add up to determine the set of permissions for user, group and others.
So by using 777, anyone - the user(=owner of the file(s)), the group that the user belongs to, and all others - can do pretty much as they like.

Which is why I recommended chown instead: chowning = changing the owner; if the files were owned by root before, they are now owned by the particular username associated with the command. Then you can use 755, which is safer.
 
Old 05-02-2007, 01:22 PM   #6
rch1231
Member
 
Registered: Mar 2007
Location: Bedford, Texas
Posts: 31

Rep: Reputation: 15
Try this instead of

chmod 777 <file or dir>

do

chmod 755 <file or dir>

This will set it to read write execute for owner, read execute for group and read execute for everyone else.
Here is how it works with spaces to separate the groups:

owner group everyone_else
rwx rwx rwx
421 421 421
7 7 7

rwx r-x r-x
421 4-1 4-1
7 5 5

rw- r-- r--
42- 4-- 4--
6 4 4

Does that help?
 
Old 05-02-2007, 07:30 PM   #7
leprkhn
LQ Newbie
 
Registered: Dec 2006
Posts: 27

Original Poster
Rep: Reputation: 15
yes that helps a lot. thank you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Home Directory Permission dvishloff Linux - General 1 08-11-2005 04:07 AM
directory permission Drunkalot Linux - General 1 07-05-2005 01:05 AM
cant change directory permission? dwarf007 Linux - General 1 09-24-2004 09:35 AM
Directory permission problem elderain Linux - Newbie 6 05-24-2004 11:25 AM
Permission for directory absolut Linux - Newbie 2 01-19-2004 04:38 AM

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

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