[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: running script from cdrom fails



Micha Feigin <michf@post.tau.ac.il> writes:

> When I try to run shell scripts from cdrom I get the following message:
> bash: ./INSTALLDOCS.SH: /bin/sh: bad interpreter: Permission denied
> I got this with several bash scripts and in fact, I don't remmember one
> that did work. Any idea?

Probably your CD-ROM is listed in /etc/fstab (the configuration file
that tells mount about your filesystems) with a line something like:

/dev/cdrom      /cdrom          iso9660 ro,user,noauto

According to the mount(8) manpage:

user   Allow an ordinary user to mount the file system.  The name
       of the mounting user is written to mtab  so  that  he  can
       unmount  the  file  system again.  This option implies the
       options noexec, nosuid, and nodev  (unless  overridden  by
       subsequent    options,    as    in    the    option   line
       user,exec,dev,suid).

noexec Do not allow execution of any binaries on the mounted file
       system.  This option might be useful for a server that has
       file systems containing binaries for  architectures  other
       than its own.

Thus, adding "exec" at some point after "user" in the list mount
options will do the trick:

/dev/cdrom      /cdrom          iso9660 ro,user,exec,noauto

With this configuration, anyone who can mount a CD on your machine can
run the executables on the CD. This isn't a problem because (a) if
someone nefarious has physical access to your machine, you're a goner
anyway, (b) under a typical setup, users can install whatever
executables they want (and thus could copy 'em from a CD to a home
directory), and (c) if a nefarious user can run "mount /cdrom" there
are almost certainly lots of other ways he can get executables onto
the machine.

-- 
Gregory K. Johnson



Reply to: