Page 1 of 1

Locked out of CHMOD? SOLVED!

Posted: Fri 10 Jan 2014, 08:02
by 8-bit
In the Quirky 6.01 files I downloaded, there are two install scripts.
They show as POSIX executable shell scripts using the properties tab.
But I would like to be able to remove the execute permission so that an accidental click on the script would not start it.

At this point, I seem to be running into a brick wall as I have been unable to change any file permissions on the files or a copy of one of them, renamed, that I was using for test purposes.

I remember that in linux/Puppy, one is supposed to have control over their system and files.

So... Does someone know something I do not?

Posted: Fri 10 Jan 2014, 09:12
by vovchik
Dear 8-bit,

Have you checked the files with chattr?

http://en.wikipedia.org/wiki/Chattr

You can make files unchangeable this way, even for root! This is good if you really don't want something changed and might be the cause of your problem.

With kind regards,
vovchik

Posted: Fri 10 Jan 2014, 13:54
by rcrsn51
In what filesystem are the scripts located - fat32?

Posted: Fri 10 Jan 2014, 16:43
by 8-bit
rcrsn51 wrote:In what filesystem are the scripts located - fat32?
The files are actually located on an NTFS partition and I was trying to change them from Puppy linux Slacko 5.5.

I suppose I could try copying one to my linux partition and see if chmod worked there.

In the mean time, I will read up on the information linked by vovchik.

I just might learn something in the process.

Problem solved! After moving the scripts to a linux partition, chmod was able to change the file's attributes.
But I did learn something in the process.
You cannot change file permissions on a file stored on an NTFS partition using linux commands!

Posted: Fri 10 Jan 2014, 19:09
by amigo
On FAT and NTFS filesystems files will always be set with 777 perms. Actually they aren't 'set' to anything, so they default to 777 under Linux. You *can* avoid them being executable with the mount option 'noexec', though.

Still, have a read about chattr and the extended file attributes available under all ext* FS's and others. Basically, 'chattr +i file' makes it 'immutable' by anyone, but, of course, root can use chattr to remove the immutable attribute with 'chattr -i file' and then it can again be modified or removed.