Author Topic: Is there a global no run in shell setting?  (Read 395 times)

Offline robert_sch

  • New Friend
  • *
  • Posts: 5
Is there a global no run in shell setting?
« on: November 02, 2012, 07:32:22 PM »
I apologise if this has been asked before, I can't seem to find an answer

while attemting to run a script I get

[foo@localhost SecondLife-i686-3.4.0.264911]$ ./secondlife
bash: ./secondlife: Permission denied

when I check permissions on it, it shows

[foo@localhost SecondLife-i686-3.4.0.264911]$ ls -l secondlife
-rwxrwxrwx 1 foo foo 6311 Sep 19 10:50 secondlife*

When I try to work arount it I get:

[foo@localhost SecondLife-i686-3.4.0.264911]$ sh secondlife
Running from /home/foo/Desktop/SecondLife-i686-3.4.0.264911
secondlife: line 86: ./etc/register_secondlifeprotocol.sh: Permission denied
secondlife: line 89: ./etc/refresh_desktop_app_entry.sh: Permission denied
secondlife: line 131: bin/do-not-directly-run-secondlife-bin: Permission denied
*** Bad shutdown ($LL_RUN_ERR). ***


even as root

-bash-4.1# whoami
root
-bash-4.1# ./secondlife
-bash: ./secondlife: Permission denied
-bash-4.1#


« Last Edit: November 02, 2012, 07:50:24 PM by robert_sch »

Offline Phil

  • Hero Member
  • *****
  • Posts: 738
Re: Is there a global no run in shell setting?
« Reply #1 on: November 03, 2012, 08:57:58 AM »
Is the file executable?

Offline xr200

  • Full Member
  • ***
  • Posts: 96
Re: Is there a global no run in shell setting?
« Reply #2 on: November 03, 2012, 11:52:11 AM »
You need to determine if there is a problem with the particular
file, with the directories in which the file resides, or  something
else.

I would open a terminal, cd to the directory in which the problem
file resides, try to create a temporary test file in that directory
(eg, > test).  If you can't create the test file, you have a parent
directory or filesystem problem or something else.   It's fine
to have no contents in file test.   If you can create test, just
as a sanity test, make it executable (chmod +x test) and then
run ./test while you are still in that directory.      What happens?

If test runs fine, then there's most likely something wrong with the file permissions
on your problem file.  run ls -l to see what they are.

If test does not run (I don't how that would happen if you could create
it...), then check the permissions of all the parent directories back to
and including / using ls -dl.    All directories should have execute
permission on.   

I think theoretically you could have the filesystem mounted non-executable,
or maybe there's some extended attribute in use on the problem file, but
I can't think of anything else.

Try the suggestions and post your results if you don't get the problem fixed.

Good Luck.

xr200


Offline robert_sch

  • New Friend
  • *
  • Posts: 5
Re: Is there a global no run in shell setting?
« Reply #3 on: November 03, 2012, 05:00:42 PM »
Thanks xr  :)
This happens on any file executed in shell
The permissions are all set as 777 for the files and all folders to /

I can execute from the desktop
I recently ran or configured something in the pclinuxos security setting as an options and vaguely recall disallowing exec in shell, but I am unable to find this setting now, is this some kind of ACL?

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6216
Re: Is there a global no run in shell setting?
« Reply #4 on: November 03, 2012, 07:02:21 PM »

can you run these two commands on the terminal and give their output?

cat /etc/fstab

cat /etc/mtab
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline robert_sch

  • New Friend
  • *
  • Posts: 5
Re: Is there a global no run in shell setting?
« Reply #5 on: November 03, 2012, 07:26:00 PM »

can you run these two commands on the terminal and give their output?

cat /etc/fstab

cat /etc/mtab

# Entry for /dev/sda1 :
UUID=1fa634fd-9043-4dc9-acac-917764fd9623 / ext3 defaults 1 1
none /dev/pts devpts defaults 0 0
# Entry for /dev/sdb1 :
UUID=ccafa64c-6c92-4ac3-9f15-4eb6e0a83e0a /home ext4 user 1 2
none /proc proc defaults 0 0
# Entry for /dev/sda5 :
UUID=49d0ad1b-2eb3-4a68-92fd-4688f7aa83ba swap swap defaults 0 0


/dev/sda1 / ext3 rw 0 0
none /proc proc rw 0 0
none /dev/pts devpts rw 0 0
/dev/sdb1 /home ext4 rw,noexec,nosuid,nodev 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
/dev/sda6 /media/disk-1 ext3 rw,nosuid,nodev,uhelper=hal 0 0

Thanks again :)

Offline xr200

  • Full Member
  • ***
  • Posts: 96
Re: Is there a global no run in shell setting?
« Reply #6 on: November 03, 2012, 07:30:11 PM »
run mount and see if the filesystem is mounted noexec.  that sounds like the problem.

xr200

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6216
Re: Is there a global no run in shell setting?
« Reply #7 on: November 03, 2012, 08:26:52 PM »

/dev/sdb1 /home ext4 rw,noexec,nosuid,nodev 0 0


The problem seem to there,your home partition is mounted with "noexec" option.

1. start pcc( pclinuxos control center )
2. click local disks
3. click manage disk partitions
4. click the tab for sdb1
5. click the bar below the tab
6. click toggle expert mode
7. click options
8. untick noexec
9. click ok and then done and then exit the pcc.
10. restart
11. try again run the script to see if the you have successfully remove the option.

ps:
what where you doing setting it in the first place? ;D
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline robert_sch

  • New Friend
  • *
  • Posts: 5
Re: Is there a global no run in shell setting?
« Reply #8 on: November 03, 2012, 08:30:41 PM »
That was it :)
Dunno.. probably following some obscure security article at 3 am in a fit of insomnia

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6216
Re: Is there a global no run in shell setting?
« Reply #9 on: November 03, 2012, 08:40:22 PM »

pcc is the best place to learn how pclinuxos works because it has options for almost every aspect of the system.

in linux knowledge, where do you put yourself? noob,intermediate or expect? We cant tell based on your post count

welcome to the forum,hope you will enjoy your stay with us.
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline robert_sch

  • New Friend
  • *
  • Posts: 5
Re: Is there a global no run in shell setting?
« Reply #10 on: November 03, 2012, 08:54:02 PM »
Intermedate - my home has been Linux only for a decade, but I tend not to deep dive into it unless something breaks..

First time I've has to ask on a forum =]
Setting it all back to 755 now