Trying to make file executable on USB, but the permission doesn't "stick" [duplicate]

Possible Duplicate:
How to 'chmod' on an NTFS ( or FAT32 ) partition?

I'm using LastPass as my password manager, and I use Sesame for multifactor authentication. On Windows this was no problem, but I alternate between Windows and Linux computers, so I need to have Sesame available for both cases.

On my laptop I'm running Ubuntu 10.10, and I downloaded the 32bit LastPass Sesame (Ubuntu 10.04 LTS) and moved the files (an executable and a .bin) to my USB device. As instructed, I tried to run chmod +x sesame on the executable (whose name is sesame).

I tried this from the terminal window, but when doing an ls -la afterwards I noticed that the permissions on the file hadn't changed a bit. I tried doing the same adding sudo at the start, but that didn't make any difference either (and I didn't get any kind of error message or anything). I also tried doing it the "graphical" way, by right-clicking on the executable in Nautilus > Properties > Permissions, and trying to check off the Allow executing file as program check box - the checked marked only disappeared again after a second.

If I moved the same executable to my hard drive, it worked very fine to make it executable (and execute it).

I'm not really experienced with Linux, so I suspect I'm missing something obvious. Might it have something to do with the USB being fat32 (but I thought files on a fat32 partition should be executable by default?), and if so - what are my options?

And just to have said it: it works very fine to run the Windows version of Sesame using Wine, but it's a bit of a hassle (at least if I need it somewhere Wine isn't already installed).


Solution 1:

You can't chmod fat32 files... . only linux filesystems "accept" linux permissions.

Easiest way would be to execute it from your home folder, for instance.... Copy it there and chmod it, then execute it as you were trying before, but at the new location.

Also you can check this: How can I run an executable from a CD when it doesn't have the executable bit set?. Basically, it talks about knowing if the file is really a binary one or it's a text script with the .bin extension. If this is the case, you can execute it with bash, python, ruby or whatever.

Solution 2:

See this answer. You basically can define permissions when mounting the device. In your case, you would do something like:

sudo mount -t vfat -o rw,user,umask=000 /path/to/device /path/to/mount/dir

For a permanent change, you can add this to your /etc/fstab:

  • Find the UUID (Universally Unique Identifier) of your device using sudo blkid.
  • Add the mount line to /etc/fstab:

    UUID=your-uuid /path/to/mount/dir vfat rw,auto,user,umask=000 0 0