I suspect your NTFS partition gets automatically mounted at boot. If we were speaking about i.e. a USB disk you attach to your computer, the permissions would be set correctly when you click on the volume in your file manager.
So there is probably an entry in your /etc/fstab
file which looks like this:
...
someWeirdId /media/name ntfs auto,stuff,stuff,stuff 0 0
change this to:
...
someWeirdId /media/name ntfs auto,stuff,stuff,stuff,uid=1000,gid=1000,umask=0000 0 0
This gives ownership of the mounted volume to the user with uid 1000, which would be the first user in your system. Enter id
on a terminal to see what uid and gid you have.
Setting umask to 0000 should grant all permissions to every user anyway.
NTFS and FAT cannot store posix permissions, like they are used by Linux (actually i'am not sure about NTFS, but I wouldn't know how).
However you can use the program fuse-posixovl to mount a directory (!) on any partition (regardless if posix permissions are suipported or not) to another directory (or the same directory if you feel like it). posixovl will create a file on the real filesystem storing the posix permissions you set in the other mountpoint. This way you get full posix functionality on any non-posix file system.
To be able to change file ownership, etc. you should run posixovl as root (via sudo).
sudo mount.posixovl /directory/on/ntfs/partition /directory/where/i/use/chown
As I said source and target directories can theoretically be the same, but try it with different directorys first, just to be sure.
The permissions will not be effective unless posixovl is used. So you can't protect your data when you attach the disk to friends computer or something. The files will be accessible anyway.
You can't modify the file permissions of a NTFS filesystem mounted via CIFS on the VFS by default. Even when chmod and chown don't complain, they have no effect under these filesystems.
Your best chance is to use mounting options to do the work. That is, define the permissions at mounting time. Take a look at man mount.cifs for the parameters uid
and gid
.
Please note that CIFS supports chmod and chown when you are serving ext4 filesystems, but not when serving NTFS filesystems. NTFS mounting support permissions, but they are disabled by default because you need to map the Windows User IDs (SID) to UIDs on your system. Please take a look at the article pointed on the comments by Eliah Kagan. Even when you can make the permissions mapping and make the permissions work with a direct mount, I don't know if they will work trhough CIFS, though.
Best Answer
The mode is determined by the partition's mount options (you cannot change it via chmod).
For '755' on files and '777' on directories you would use something like