13

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).

0

2 Answers 2

9

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.

5
  • 1
    I kind of suspected that, but how then can I execute the file from the USB device?
    – Julian
    Jan 24, 2011 at 21:26
  • I edited the answer... hope it helps.
    – luri
    Jan 24, 2011 at 21:33
  • ok, guess I'll be just as good off by using the Windows version through Wine then. Thanks.
    – Julian
    Jan 24, 2011 at 22:03
  • 1
    Just out of curiosity btw: are there any special reason why I didn't get any kind of error message what so ever when I tried to run chmod +x sesame on the executable on the USB drive? Such an error message would have cleared things up instantaneously...
    – Julian
    Jan 25, 2011 at 7:19
  • 1
    10 years later, wondering the same thing. Why no error message?
    – Zach
    Dec 30, 2020 at 23:59
8

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
    
2
  • thanks, that's another possible option. However, the point with the Sesame multifactor authentication on an USB drive, is that it should be quick and easy to plug it into any random computer. I just want to plug it in (Ubuntu auto-mounts it for me), click the executable and get my one-time key, so compared to that this is kind of a hassle. But I'll take note of it just in case :)
    – Julian
    Jan 25, 2011 at 7:15
  • @Nailuj If you can reformat your flash drive, I think formatting it ext4 (probably with journaling disabled) should allow you to change permissions. Note though that this will prevent you from using your flash drive with Windows machines. Oct 14, 2015 at 10:42

Not the answer you're looking for? Browse other questions tagged .