- Пытаюсь установить run файл, а сообщается: Permission denied
- Re: Пытаюсь установить run файл, а сообщается: Permission denied
- Re: Пытаюсь установить run файл, а сообщается: Permission denied
- Re: Пытаюсь установить run файл, а сообщается: Permission denied
- Ошибка bash permission denied
- Ошибка bash permission denied
- Выводы
- reading a file: permission denied
- 2 Answers 2
- Permission denied running my own program on Linux? [closed]
- 9 Answers 9
- Ubuntu says «bash: ./program Permission denied» [closed]
- 3 Answers 3
Пытаюсь установить run файл, а сообщается: Permission denied
Под root пытаюсь установить игру:
phantom:/home/boron/Desktop # ./privgold10.bz2.run
bash: ./privgold10.bz2.run: Permission denied
Понять не могу — почему не хватает прав (уже второй файл так). Либо я разучился устанавливать run файлы, либо. не знаю что либо.
Кто что подсказать сможет?
Re: Пытаюсь установить run файл, а сообщается: Permission denied
посмотри права на него ls -lh privgold10.bz2.run
должны стоять x x x
если нет то попробой
тоесть запустить сам шел sh, указав ему файл скрипт
если и это не будет работать то загляни в этот файл
может это и не скрипт
ещё 10.bz2.r говорит о том что это архив, но по идее он может сам себя распаковать, по идее
Re: Пытаюсь установить run файл, а сообщается: Permission denied
/Desktop> ls -lh privgold10.bz2.run
-rw-rw-rw- 1 boron users 184M 2007-06-12 23:41 privgold10.bz2.run
phantom:/home/boron/Desktop # sh privgold10.bz2.run
Verifying archive integrity. All good.
Uncompressing Vegastrike Space Simulator 0.4.3 — Base
Вообщем при помощи команды sh установка игры началась 😉
Re: Пытаюсь установить run файл, а сообщается: Permission denied
Можно еще chmod +x сделать на файл и потом его стартануть 🙂 Хакеры, млин 🙂
Источник
Ошибка bash permission denied
Многие новички пытаются выполнить запись определенных значений в системные файлы с помощью операторов перенаправления ввода и вывода и получают ошибку bash permission denied. Эта ошибка выводится, даже если вы использовали sudo.
Казалось бы, sudo есть, значит права суперпользователя получены и все должно работать но тут все не так просто. В этой статье мы рассмотрим почему возникает ошибка bash permission denied и как ее обойти.
Ошибка bash permission denied
Допустим, вы выполняете команду:
sudo echo «nameserver 8.8.8.8» >> /etc/resolv.conf
А в результате вместо записи строчки в /etc/resolv.conf получаете ошибку:
bash: /etc/resolv.conf permission denied
В русской локализации это будет отказано в доступе bash linux. Так происходит потому что вы запускаете с правами суперпользователя утилиту echo и она честно выводит вашу строку в стандартный вывод bash с правами суперпользователя. Но bash запущен от обычного пользователя, и когда интерпретатор bash пытается записать полученную строчку в системный файл, естественно, что вы получите ошибку.
Но существует несколько способов обойти это ограничение, вы можете, например, использовать команду tee, которая записывает стандартный вывод в файл или запустить саму оболочку от имени суперпользователя. Рассмотрим сначала вариант с tee:
echo ‘текст’ | sudo tee -a /путь/к/файлу
echo ‘nameserver 8.8.8.8’ | sudo tee -a /etc/resolv.conf
Это очень простое решение, но, кроме того, вы можете запустить оболочку bash с правами суперпользователя, чтобы дать ей доступ на запись:
sudo sh -c ‘echo текст >> /путь/к/файлу’
sudo bash -c ‘echo текст >> /путь/к/файлу’
sudo bash -c ‘echo nameserver 8.8.8.8 >> /etc/resolv.conf
Еще одно решение, призванное, упростить эту команду, добавить такой код в
sudoe() <
[[ «$#» -ne 2 ]] && echo «Usage: sudoe
» && return 1
echo «$1» | sudo tee —append «$2» > /dev/null
>
Дальше для вывода строки в файл выполняйте:
sudoe ‘текст’ >> /путь/к/файлу
sudoe «nameserver 8.8.8.8» > /etc/resolv.conf
Теперь все будет работать, как и ожидалось, и ошибка bash отказано в доступе не появится. Еще можно поменять права на файл, а потом уже выводить в него строку. Но это очень неправильное решение. И даже не потому, что это небезопасно, а больше потому что там намного больше действий.
Выводы
В этой небольшой статье мы разобрали почему возникает ошибка bash permission denied при использовании команды echo для системных файлов, а также несколько путей ее решения. Как видите, все достаточно просто. Надеюсь, эта информация была полезной для вас.
Источник
reading a file: permission denied
I have set these permissions on a file:
Now I try to open the file with user rick who is a member of the group rick.
Why can’t he read it?
2 Answers 2
Since the accessing process has userid «rick», only the owning-user permissions, which forbid reading, are checked. Only if the accessing process does not have the same userid as the owner of the file will the kernel consider the possibility that it might be a member of the file’s group.
Any process running as the owning user of a file can use the chmod system call to set its permission bits to whatever they want, so denying read or write access to the owning user is ineffective as a security measure, but it can still be a useful safety measure. In other words, you can use the permission bits to prevent a file from being clobbered by its owning user by accident, but not on purpose.
Your permissions are set now to read just for «group» and «others».
As said in the comments, the user rick does belong to the group, but what counts is the fact that is the owner, so the permissions checked are the ones on the first column, which happen to be — , that is 0 . Hence, the group is not taken into consideration.
Change the permissions to something more normal 🙂
Then you will be able to read it. As the permissions go as follows:
Источник
Permission denied running my own program on Linux? [closed]
Want to improve this question? Update the question so it’s on-topic for Stack Overflow.
Closed 1 year ago .
I have Ubuntu 9.4. I’ve built the program, some basic OpenGL. The program just makes a rotating square. Then run it and:
And an empty main doesn’t work:
How can I make that disappear?
9 Answers 9
I had the same problem and it appeared that my partition was mounted as noexec cat /etc/mtab
When I configured options in /etc/fstab I wrote exec,user but it appears that «user» option by default sets up «noexec». When I changed the order of these two to user,exec everything went back to normal!
How are you compiling it? Can you post the makefile? If you run
Check the mountpoint to see if it’s mounted as noexec by running «mount»
I use CodeBlocks on Ubuntu and have had this exact problem MANY times. what KermiDT said is exactly the solution (if i had enough rep points, i would have voted it up)
The «user» option by default sets up «noexec».
so in /etc/fstab just add ,exec after user. i.e. mine looks like this:
/dev/sda6 /media/DATA vfat uid=kenny,gid=kenny,users,user,exec 0 0
Though, the spacingis a bit off. but you get the idea.
Apart from the above mentioned chmod +x file, another problem might be a missing library. To check the required libraries, use ldd:
If one of these lines shows a missing library, you’ll know what needs to be installed before you can run your program.
Another possibility is if your program is a script (shell, perl, python or other text-based program). The first line looks like:
If that file cannot be found, you’ll get a permission denied error.
Источник
Ubuntu says «bash: ./program Permission denied» [closed]
Want to improve this question? Update the question so it’s on-topic for Stack Overflow.
Closed last month .
I am running Ubuntu on computer 1 and computer 2. I compiled a C++ program on computer 1, and I can execute it from the terminal using ./program_name . It runs fine.
However, when I try to do this on computer 2, it says: bash: ./program_name: permission denied
What’s wrong and what can I do about it?
3 Answers 3
chmod u+x program_name . Then execute it.
If that does not work, copy the program from the USB device to a native volume on the system. Then chmod u+x program_name on the local copy and execute that.
Unix and Unix-like systems generally will not execute a program unless it is marked with permission to execute. The way you copied the file from one system to another (or mounted an external volume) may have turned off execute permission (as a safety feature). The command chmod u+x name adds permission for the user that owns the file to execute it.
That command only changes the permissions associated with the file; it does not change the security controls associated with the entire volume. If it is security controls on the volume that are interfering with execution (for example, a noexec option may be specified for a volume in the Unix fstab file, which says not to allow execute permission for files on the volume), then you can remount the volume with options to allow execution. However, copying the file to a local volume may be a quicker and easier solution.
Источник