Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-10-2011, 04:40 PM   #1
Registered: Dec 2009
Distribution: Slackware 14
Posts: 282

Rep: Reputation: 64
Why is it a bad idea to enable scripts to be run from a usb drive?

Sorry about the title, I didnt know how else to put it.

I've got a 1TB external usb hard drive, that I'd like to run some scripts from, but I think I remember reading somewhere that its not a good idea, and that that practice was actually disabled at some point in the past, I was just wondering why?

Last edited by clifford227; 04-10-2011 at 04:42 PM.
Old 04-10-2011, 05:18 PM   #2
Senior Member
Registered: Aug 2009
Distribution: CentOS
Posts: 2,103

Rep: Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884
The potential problem is that an external drive could contain binaries or scripts intended for a different operating system, and accidentally executing one could have unfortunate results.

For just running the occasional script, you can directly invoke the shell (or perl, or python, or whatever other interpreter the script requires) and pass it the name of the script file. As far as the OS is concerned, the interpreter is just reading that file, and execute permission is irrelevant.
bash some_script_file arg1 arg2 ...
This isn't going to work, though, if that script tries to execute other programs or scripts from that noexec file system.
1 members found this post helpful.
Old 04-10-2011, 05:19 PM   #3
LQ Guru
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
As a security measure, executable files are often disabled on removable devices. Otherwise it could be possible for a user to unknowingly run a piece of malicious software simply by plugging in a removable drive.

I am not aware of any other reason they would be blocked, though your question is somewhat vague in general (I.E. what are these "scripts" in the first place).
1 members found this post helpful.
Old 04-10-2011, 05:52 PM   #4
Registered: Dec 2009
Distribution: Slackware 14
Posts: 282

Original Poster
Rep: Reputation: 64
Thanks guys,

basically the scripts I want to run just display a .jpg of a comedy programme in feh, and then have mplayer shuffle through a list of favorite comedy shows which are on the external usb drive.

Last edited by clifford227; 04-10-2011 at 05:54 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable/enable USB storage device @ run time Mr.J Linux - Security 1 09-08-2008 10:16 AM
Disable/enable USB storage device @ run time Mr.J Linux - Kernel 3 08-03-2008 08:14 AM
reformatting external drive... bad idea? tommytomthms5 Linux - Hardware 5 05-19-2008 05:28 AM
usb drive won't mount - error: wrong fs type, bad option, bad superblock on /dev/sda1 bluecog6 Linux - Hardware 4 01-27-2007 09:07 AM
Good idea/bad idea: interface colors introuble General 5 10-30-2006 01:33 PM

All times are GMT -5. The time now is 07:31 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration