chmod problem in ubuntu

0

I want to change user permissions of lots of files but I can not! I use this code:

administrator@unknown:~$ sudo chmod 700 *  -R

or

administrator@unknown:~$ sudo chmod 700 myfile -R

I want to change permission of file that no one except me can see file and directories! It seems to be correct and no error appears but permission of file won't change!

  • Files created by windows 7,So default permission is 777, and owner is root!

Thanks for any help or suggestion!

undone

Posted 2011-04-23T09:59:35.523

Reputation: 824

2If it's a mounted FAT/NTFS disk, you can't change permissions. – None – 2011-04-23T10:01:57.090

@adamax: The ntfs-3g driver supports mapping of POSIX permissions to NTFS ACLs. (Not sure if the feature is already in Ubuntu, though.) – user1686 – 2011-04-23T12:44:47.197

Answers

3

If its NTFS or FAT you can tweak the mount options of the entire mountpoint:

Ntfs:

rw,user,auto,fmask=0177,dmask=0077,uid=1000

FAT:

user,auto,fmask=0177,dmask=0077,uid=1000

See the howto here

sehe

Posted 2011-04-23T09:59:35.523

Reputation: 1 796

3

The permissions on a file do not influence its listing in a directory. Instead, change the the permissions of the directory with

sudo chmod 700 .

Also, make sure your file system drivers support UNIX permissions. ext*, XFS, etc. do, but not FAT and only some NTFS implementations.

phihag

Posted 2011-04-23T09:59:35.523

Reputation: 2 557

1The ntfs-3g driver supports mapping of POSIX permissions to NTFS ACLs. – user1686 – 2011-04-23T12:43:48.667