LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   permission question (https://www.linuxquestions.org/questions/linux-newbie-8/permission-question-538148/)

IMOBoss 03-16-2007 07:31 PM

permission question
 
How to change permission for folder and files?
When I type e.g.

#chmod 755 folder

that change permission only folder but not for files and subfolders.

GrapefruiTgirl 03-16-2007 07:40 PM

the -R option will recursively chmod files and folders.
Check the man page by typing man chmod in a console
:)

jschiwal 03-16-2007 07:43 PM

I don't think you are very clear with your question. The same command is used for both files and directories.
The permissions themselves, like the execution bit, and the sticky bit may have a different meaning for directories then for files.

Perhaps you meant to ask, how to change the permissions on a directory and all subdirectories and files inside.
You can use the recursive option.

See the man page of chmod for details. The info page for coreutils has more information about file permissions.

IMOBoss 03-17-2007 10:17 AM

actually this is a problem
I have Linux on my IDE disc, and now attached new SATA disc with two NTFS partition and when I mount that, only root can access. How to change that another user can access?

GrapefruiTgirl 03-17-2007 11:11 AM

ok, in your fstab file you should have something like this: let's call the NTFS partitions hda2 & hda3.

Code:

/dev/hda2 /mount/point1 NTFS defaults,noauto,user 0 0
/dev/hda3 /mount/point2 NTFS defaults,noauto,user 0 0

This will allow a user to mount the partitions once the system is booted. That user will then be the owner of the devices.
If you want them to mount during boot, then remove the noauto option. Note that if you do this, user ROOT will be mounting the drives during boot, so ROOT will have to unmount them if you want to remount them as a user. Also make sure the mountpoint is accessible by the user also, and not only ROOT. You could also in this case assign a UID= to the devices, making them mount and owned by user <uid#>
If you still have problems, you may need to make sure the etc/fstab file is readable by the user, not just ROOT.
Let us know if this works.
Also, check the man page for full details: type 'man mount' or 'man fstab'


All times are GMT -5. The time now is 02:23 AM.