Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In Debian Testing (Wheezy) 64bit, I am trying to install TrueCrypt:

root@debian:/media/cdrom0# ls -l
total 47120
dr-xr-xr-x 3 root root     2048 Apr  3  2012 32Bit
dr-xr-xr-x 2 root root     2048 Apr  3  2012 64Bit
-r-xr-xr-x 1 root root      647 Aug 16  2011 AUTORUN.INF
-r-xr-xr-x 1 root root     6966 Apr  3  2012 autorun.sh
-r-xr-xr-x 1 root root     5523 Apr  3  2012 runasroot.sh
-r-xr-xr-x 1 root root  7669198 Apr  3  2012 VBoxLinuxAdditions.run
-r-xr-xr-x 1 root root 19237888 Apr  3  2012 VBoxSolarisAdditions.pkg
-r-xr-xr-x 1 root root 13618128 Apr  3  2012 VBoxWindowsAdditions-amd64.exe
-r-xr-xr-x 1 root root   282928 Apr  3  2012 VBoxWindowsAdditions.exe
-r-xr-xr-x 1 root root  7424032 Apr  3  2012 VBoxWindowsAdditions-x86.exe
root@debian:/media/cdrom0# ./VBoxLinuxAdditions.run
bash: ./VBoxLinuxAdditions.run: Permission denied
root@debian:/media/cdrom0# 

Why am I getting Permission denied when logged in as root?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You need to make the file executable with e.g.

chmod +x VBoxLinuxAdditions.run

and then run it. If you check with ls -l again afterwards, you will see that the x flag will be set, for "executable".

Quick summary from Wikipedia:

There are three specific permissions on Unix-like systems that apply to each class:

  • The read permission, which grants the ability to read a file. When set for a directory, this permission grants the ability to read the names of files in the directory (but not to find out any further information about them such as contents, file type, size, ownership, permissions, etc.)

  • The write permission, which grants the ability to modify a file. When set for a directory, this permission grants the ability to modify entries in the directory. This includes creating files, deleting files, and renaming files.

  • The execute permission, which grants the ability to execute a file. This permission must be set for executable binaries (for example, a compiled C++ program) or shell scripts (for example, a Perl program) in order to allow the operating system to run them. When set for a directory, this permission grants the ability to access file contents and metainfo if its name is known, but not list files inside the directory (unless read is set).


Edit: as noted in the comment below (or in the original post if one notices the path /media/cdrom0/) the file was on a read-only media. Either the complete structure could be copied to a writable medium and the permissions changed, or one could run them directly from the disc with an explicit interpreter such as

sh VBoxLinuxAdditions.run

or

bash VBoxLinuxAdditions.run

If none of these interpreters work, one can check the intended interpreter with e.g.

head -1 VBoxLinuxAdditions.run

but it is most likely a regular shell script.

share|improve this answer
    
But the file is on a CD. I am supposed to copy it to the HDD? –  oshirowanen Mar 2 '13 at 13:30
    
@oshirowanen: You could do that (but that will probably mess up file paths for the installer, unless you copy the entire CD), or run it explicitly with the correct interpreter via e.g. sh VBoxLinuxAdditions.run or bash VBoxLinuxAdditions.run. –  Daniel Andersson Mar 2 '13 at 13:32
    
sh VBoxLinuxAdditions.run worked perfectly. Thanks! –  oshirowanen Mar 2 '13 at 13:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.